From 93869e1311cc59a881a979eea144f8570c45d9df Mon Sep 17 00:00:00 2001 From: Christoph Hasse Date: Fri, 15 Jan 2021 16:23:32 +0100 Subject: [PATCH] use EXV_PRINT_TAG macro instead of specific print function --- src/nikonmn_int.cpp | 36 +++++++++++------------------------- src/nikonmn_int.hpp | 2 -- 2 files changed, 11 insertions(+), 27 deletions(-) diff --git a/src/nikonmn_int.cpp b/src/nikonmn_int.cpp index f573bfda..757fb8d7 100644 --- a/src/nikonmn_int.cpp +++ b/src/nikonmn_int.cpp @@ -104,6 +104,16 @@ namespace Exiv2 { N_("Right-most") }; + //! Shutter Modes (credits to exiftool) + extern const TagDetails nikonShutterModes[] = { + { 0, "Mechanical" }, + { 16, "Electronic" }, + { 48, "Electronic Front Curtain" }, + { 64, "Electronic (Movie)" }, + { 80, "Auto (Mechanical)" }, + { 81, "Auto (Electronic Front Curtain)" } + }; + //! FlashComp, tag 0x0012 extern const TagDetails nikonFlashComp[] = { // From the PHP JPEG Metadata Toolkit @@ -589,7 +599,7 @@ namespace Exiv2 { TagInfo(0x0024, "WorldTime", N_("World Time"), N_("World time"), nikon3Id, makerTags, undefined, -1, printValue), TagInfo(0x0025, "ISOInfo", N_("ISO Info"), N_("ISO info"), nikon3Id, makerTags, undefined, -1, printValue), TagInfo(0x002a, "VignetteControl", N_("Vignette Control"), N_("Vignette control"), nikon3Id, makerTags, unsignedShort, -1, EXV_PRINT_TAG(nikonOlnh)), - TagInfo(0x0034, "ShutterMode", N_("Shutter Mode"), N_("Shutter mode"), nikon3Id, makerTags, unsignedShort, -1, print0x0034), + TagInfo(0x0034, "ShutterMode", N_("Shutter Mode"), N_("Shutter mode"), nikon3Id, makerTags, unsignedShort, -1, EXV_PRINT_TAG(nikonShutterModes)), TagInfo(0x0037, "MechanicalShutterCount", N_("Mechanical Shutter Count"), N_("Mechanical shutter count"), nikon3Id, makerTags, unsignedLong, -1, printValue), TagInfo(0x0080, "ImageAdjustment", N_("Image Adjustment"), N_("Image adjustment setting"), nikon3Id, makerTags, asciiString, -1, printValue), TagInfo(0x0081, "ToneComp", N_("Tone Compensation"), N_("Tone compensation"), nikon3Id, makerTags, asciiString, -1, printValue), @@ -1531,30 +1541,6 @@ namespace Exiv2 { return os; } - // shutter mode value conversions, taken from exiftool - std::ostream& Nikon3MakerNote::print0x0034(std::ostream& os, - const Value& value, - const ExifData*) - { - long focus = value.toLong(); - switch (focus) { - case 0: os << "Mechanical"; - break; - case 16: os << "Electronic"; - break; - case 48: os << "Electronic Front Curtain"; - break; - case 64: os << "Electronic (Movie)"; - break; - case 80: os << "Auto (Mechanical)"; - break; - case 81: os << "Auto (Electronic Front Curtain)"; - break; - default: os << "Unknown Shutter Mode"; - } - return os; - } - std::ostream& Nikon3MakerNote::print0x0083(std::ostream& os, const Value& value, const ExifData*) diff --git a/src/nikonmn_int.hpp b/src/nikonmn_int.hpp index 6561961b..e777e4ad 100644 --- a/src/nikonmn_int.hpp +++ b/src/nikonmn_int.hpp @@ -176,8 +176,6 @@ namespace Exiv2 { static std::ostream& print0x0002(std::ostream& os, const Value& value, const ExifData*); //! Print autofocus mode static std::ostream& print0x0007(std::ostream& os, const Value& value, const ExifData*); - //! Print shutter mode - static std::ostream& print0x0034(std::ostream& os, const Value& value, const ExifData*); //! Print lens type static std::ostream& print0x0083(std::ostream& os, const Value& value, const ExifData*); //! Print lens information