Skip to content

Commit

Permalink
Add Mustang I v2 Studio Preamp
Browse files Browse the repository at this point in the history
  • Loading branch information
offa committed Sep 24, 2024
1 parent 21b4f0c commit 5fb8e00
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 1 deletion.
2 changes: 2 additions & 0 deletions include/com/IdLookup.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ namespace plug
return amps::AMERICAN_90S;
case 0x6d:
return amps::METAL_2000;
case 0xf1:
return amps::STUDIO_PREAMP;
default:
throw std::invalid_argument{"Invalid amp id: " + std::to_string(id)};
}
Expand Down
5 changes: 4 additions & 1 deletion include/effects_enum.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ namespace plug
BRITISH_70S,
BRITISH_80S,
AMERICAN_90S,
METAL_2000
METAL_2000,

// Mustang I v2
STUDIO_PREAMP
};


Expand Down
4 changes: 4 additions & 0 deletions src/com/PacketSerializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,10 @@ namespace plug::com
payload.setModel(0x6d);
payload.setUnknownAmpSpecific(0x08, 0x08, 0x08, 0x08, 0x75);
break;
case amps::STUDIO_PREAMP:
payload.setModel(0xf1);
payload.setUnknownAmpSpecific(0x0d, 0x0d, 0x0d, 0x0d, 0xf6);
break;
}

return Packet<AmpPayload>{header, payload};
Expand Down
6 changes: 6 additions & 0 deletions src/ui/amplifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,12 @@ namespace plug
setAccessibleName("Amplifier: Metal 2000");
break;

case amps::STUDIO_PREAMP:
advanced->change_cabinet(value(cabinets::cab4x12G));
advanced->change_noise_gate(0);
setWindowTitle("Amplifier: Studio Preamp");
setAccessibleName("Amplifier: Studio Preamp");

default:
break;
}
Expand Down
6 changes: 6 additions & 0 deletions src/ui/savetofile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,12 @@ namespace plug
something = 0x08;
something2 = 0x75;
break;

case amps::STUDIO_PREAMP:
model = 0xf1;
something = 0x0d;
something2 = 0xf6;
break;
}

xml->writeStartElement("Amplifier");
Expand Down
2 changes: 2 additions & 0 deletions test/IdLookupTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ namespace plug::test
EXPECT_EQ(lookupAmpById(0x5e), amps::BRITISH_80S);
EXPECT_EQ(lookupAmpById(0x5d), amps::AMERICAN_90S);
EXPECT_EQ(lookupAmpById(0x6d), amps::METAL_2000);

EXPECT_EQ(lookupAmpById(0xf1), amps::STUDIO_PREAMP);
}

TEST_F(IdLookupTest, lookupAmpByIdThrowsOnInvalidId)
Expand Down
2 changes: 2 additions & 0 deletions test/PacketSerializerTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,8 @@ namespace plug::test
EXPECT_THAT(serializeWithType(amps::BRITISH_80S), AmpDataIs(0x5e, 0x80, 0x09, 0x5d));
EXPECT_THAT(serializeWithType(amps::AMERICAN_90S), AmpDataIs(0x5d, 0x80, 0x0a, 0x6d));
EXPECT_THAT(serializeWithType(amps::METAL_2000), AmpDataIs(0x6d, 0x80, 0x08, 0x75));

EXPECT_THAT(serializeWithType(amps::STUDIO_PREAMP), AmpDataIs(0xf1, 0x80, 0x0d, 0xf6));
}

TEST_F(PacketSerializerTest, serializeAmpSettingsCabinetData)
Expand Down

0 comments on commit 5fb8e00

Please sign in to comment.