Skip to content

Commit

Permalink
#11565: Fixing the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
krasko78 committed Nov 1, 2024
1 parent 8072952 commit 628dfa7
Show file tree
Hide file tree
Showing 11 changed files with 117 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/framework/stubs/midi/midiconfigurationstub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ void MidiConfigurationStub::setUseRemoteControl(bool)

async::Channel<bool> MidiConfigurationStub::useRemoteControlChanged() const
{
static async::Channel<bool> n;
return n;
static async::Channel<bool> ch;
return ch;
}

MidiDeviceID MidiConfigurationStub::midiInputDeviceId() const
Expand All @@ -55,8 +55,8 @@ void MidiConfigurationStub::setMidiInputDeviceId(const MidiDeviceID&)

async::Notification MidiConfigurationStub::midiInputDeviceIdChanged() const
{
static async::Notification n;
return n;
static async::Notification ch;
return ch;
}

MidiDeviceID MidiConfigurationStub::midiOutputDeviceId() const
Expand Down
6 changes: 6 additions & 0 deletions src/framework/stubs/shortcuts/shortcutsconfigurationstub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,9 @@ bool ShortcutsConfigurationStub::advanceToNextNoteOnKeyRelease() const
void ShortcutsConfigurationStub::setAdvanceToNextNoteOnKeyRelease(bool)
{
}

async::Channel<bool> ShortcutsConfigurationStub::advanceToNextNoteOnKeyReleaseChanged() const
{
static async::Channel<bool> ch;
return ch;
}
1 change: 1 addition & 0 deletions src/framework/stubs/shortcuts/shortcutsconfigurationstub.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class ShortcutsConfigurationStub : public IShortcutsConfiguration

bool advanceToNextNoteOnKeyRelease() const override;
void setAdvanceToNextNoteOnKeyRelease(bool value) override;
muse::async::Channel<bool> advanceToNextNoteOnKeyReleaseChanged() const override;
};
}

Expand Down
6 changes: 6 additions & 0 deletions src/framework/stubs/update/updateconfigurationstub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ void UpdateConfigurationStub::setNeedCheckForUpdate(bool)
{
}

muse::async::Notification UpdateConfigurationStub::needCheckForUpdateChanged() const
{
static muse::async::Notification n;
return n;
}

std::string UpdateConfigurationStub::skippedReleaseVersion() const
{
return "";
Expand Down
1 change: 1 addition & 0 deletions src/framework/stubs/update/updateconfigurationstub.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class UpdateConfigurationStub : public IUpdateConfiguration

bool needCheckForUpdate() const override;
void setNeedCheckForUpdate(bool needCheck) override;
muse::async::Notification needCheckForUpdateChanged() const override;

std::string skippedReleaseVersion() const override;
void setSkippedReleaseVersion(const std::string& version) override;
Expand Down
54 changes: 54 additions & 0 deletions src/stubs/notation/notationconfigurationstub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,12 @@ void NotationConfigurationStub::setSelectionProximity(int)
{
}

muse::async::Channel<int> NotationConfigurationStub::selectionProximityChanged() const
{
static muse::async::Channel<int> ch;
return ch;
}

ZoomType NotationConfigurationStub::defaultZoomType() const
{
return ZoomType::PageWidth;
Expand All @@ -182,6 +188,12 @@ void NotationConfigurationStub::setDefaultZoom(int)
{
}

muse::async::Notification NotationConfigurationStub::defaultZoomChanged() const
{
static muse::async::Notification n;
return n;
}

QList<int> NotationConfigurationStub::possibleZoomPercentageList() const
{
return QList<int>();
Expand All @@ -206,6 +218,12 @@ void NotationConfigurationStub::setMouseZoomPrecision(int)
{
}

muse::async::Notification NotationConfigurationStub::mouseZoomPrecisionChanged() const
{
static muse::async::Notification n;
return n;
}

std::string NotationConfigurationStub::fontFamily() const
{
return std::string();
Expand Down Expand Up @@ -240,6 +258,12 @@ void NotationConfigurationStub::setDefaultStyleFilePath(const muse::io::path_t&)
{
}

muse::async::Channel<muse::io::path_t> NotationConfigurationStub::defaultStyleFilePathChanged() const
{
static muse::async::Channel<muse::io::path_t> ch;
return ch;
}

muse::io::path_t NotationConfigurationStub::partStyleFilePath() const
{
return muse::io::path_t();
Expand All @@ -249,6 +273,12 @@ void NotationConfigurationStub::setPartStyleFilePath(const muse::io::path_t&)
{
}

muse::async::Channel<muse::io::path_t> NotationConfigurationStub::partStyleFilePathChanged() const
{
static muse::async::Channel<muse::io::path_t> ch;
return ch;
}

bool NotationConfigurationStub::isMidiInputEnabled() const
{
return false;
Expand Down Expand Up @@ -359,6 +389,12 @@ void NotationConfigurationStub::setColorNotesOutsideOfUsablePitchRange(bool)
{
}

muse::async::Channel<bool> NotationConfigurationStub::colorNotesOutsideOfUsablePitchRangeChanged() const
{
static muse::async::Channel<bool> ch;
return ch;
}

int NotationConfigurationStub::delayBetweenNotesInRealTimeModeMilliseconds() const
{
return 100;
Expand All @@ -368,6 +404,12 @@ void NotationConfigurationStub::setDelayBetweenNotesInRealTimeModeMilliseconds(i
{
}

muse::async::Channel<int> NotationConfigurationStub::delayBetweenNotesInRealTimeModeMillisecondsChanged() const
{
static muse::async::Channel<int> ch;
return ch;
}

int NotationConfigurationStub::notePlayDurationMilliseconds() const
{
return 100;
Expand All @@ -377,6 +419,12 @@ void NotationConfigurationStub::setNotePlayDurationMilliseconds(int)
{
}

muse::async::Channel<int> NotationConfigurationStub::notePlayDurationMillisecondsChanged() const
{
static muse::async::Channel<int> ch;
return ch;
}

void NotationConfigurationStub::setTemplateModeEnabled(std::optional<bool>)
{
}
Expand Down Expand Up @@ -501,3 +549,9 @@ muse::io::path_t NotationConfigurationStub::styleFileImportPath() const
void NotationConfigurationStub::setStyleFileImportPath(const muse::io::path_t&)
{
}

muse::async::Channel<std::string> NotationConfigurationStub::styleFileImportPathChanged() const
{
static muse::async::Channel<std::string> ch;
return ch;
}
10 changes: 10 additions & 0 deletions src/stubs/notation/notationconfigurationstub.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,20 +75,24 @@ class NotationConfigurationStub : public INotationConfiguration

int selectionProximity() const override;
void setSelectionProximity(int proximity) override;
muse::async::Channel<int> selectionProximityChanged() const override;

ZoomType defaultZoomType() const override;
void setDefaultZoomType(ZoomType zoomType) override;

int defaultZoom() const override;
void setDefaultZoom(int zoomPercentage) override;

muse::async::Notification defaultZoomChanged() const override;

QList<int> possibleZoomPercentageList() const override;

qreal scalingFromZoomPercentage(int zoomPercentage) const override;
int zoomPercentageFromScaling(qreal scaling) const override;

int mouseZoomPrecision() const override;
void setMouseZoomPrecision(int precision) override;
muse::async::Notification mouseZoomPrecisionChanged() const override;

std::string fontFamily() const override;
int fontSize() const override;
Expand All @@ -99,9 +103,11 @@ class NotationConfigurationStub : public INotationConfiguration

muse::io::path_t defaultStyleFilePath() const override;
void setDefaultStyleFilePath(const muse::io::path_t& path) override;
muse::async::Channel<muse::io::path_t> defaultStyleFilePathChanged() const override;

muse::io::path_t partStyleFilePath() const override;
void setPartStyleFilePath(const muse::io::path_t& path) override;
muse::async::Channel<muse::io::path_t> partStyleFilePathChanged() const override;

bool isMidiInputEnabled() const override;
void setIsMidiInputEnabled(bool enabled) override;
Expand Down Expand Up @@ -135,12 +141,15 @@ class NotationConfigurationStub : public INotationConfiguration

bool colorNotesOutsideOfUsablePitchRange() const override;
void setColorNotesOutsideOfUsablePitchRange(bool value) override;
muse::async::Channel<bool> colorNotesOutsideOfUsablePitchRangeChanged() const override;

int delayBetweenNotesInRealTimeModeMilliseconds() const override;
void setDelayBetweenNotesInRealTimeModeMilliseconds(int delayMs) override;
muse::async::Channel<int> delayBetweenNotesInRealTimeModeMillisecondsChanged() const override;

int notePlayDurationMilliseconds() const override;
void setNotePlayDurationMilliseconds(int durationMs) override;
muse::async::Channel<int> notePlayDurationMillisecondsChanged() const override;

void setTemplateModeEnabled(std::optional<bool> enabled) override;
void setTestModeEnabled(std::optional<bool> enabled) override;
Expand Down Expand Up @@ -182,6 +191,7 @@ class NotationConfigurationStub : public INotationConfiguration

muse::io::path_t styleFileImportPath() const override;
void setStyleFileImportPath(const muse::io::path_t& path) override;
muse::async::Channel<std::string> styleFileImportPathChanged() const override;
};
}

Expand Down
18 changes: 18 additions & 0 deletions src/stubs/playback/playbackconfigurationstub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ void PlaybackConfigurationStub::setPlayNotesWhenEditing(bool)
{
}

muse::async::Channel<bool> PlaybackConfigurationStub::playNotesWhenEditingChanged() const
{
static muse::async::Channel<bool> ch;
return ch;
}

bool PlaybackConfigurationStub::playChordWhenEditing() const
{
return false;
Expand All @@ -42,6 +48,12 @@ void PlaybackConfigurationStub::setPlayChordWhenEditing(bool)
{
}

muse::async::Channel<bool> PlaybackConfigurationStub::playChordWhenEditingChanged() const
{
static muse::async::Channel<bool> ch;
return ch;
}

bool PlaybackConfigurationStub::playHarmonyWhenEditing() const
{
return false;
Expand All @@ -51,6 +63,12 @@ void PlaybackConfigurationStub::setPlayHarmonyWhenEditing(bool)
{
}

muse::async::Channel<bool> PlaybackConfigurationStub::playHarmonyWhenEditingChanged() const
{
static muse::async::Channel<bool> ch;
return ch;
}

PlaybackCursorType PlaybackConfigurationStub::cursorType() const
{
return PlaybackCursorType::SMOOTH;
Expand Down
3 changes: 3 additions & 0 deletions src/stubs/playback/playbackconfigurationstub.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,15 @@ class PlaybackConfigurationStub : public IPlaybackConfiguration
public:
bool playNotesWhenEditing() const override;
void setPlayNotesWhenEditing(bool value) override;
muse::async::Channel<bool> playNotesWhenEditingChanged() const override;

bool playChordWhenEditing() const override;
void setPlayChordWhenEditing(bool value) override;
muse::async::Channel<bool> playChordWhenEditingChanged() const override;

bool playHarmonyWhenEditing() const override;
void setPlayHarmonyWhenEditing(bool value) override;
muse::async::Channel<bool> playHarmonyWhenEditingChanged() const override;

PlaybackCursorType cursorType() const override;

Expand Down
12 changes: 12 additions & 0 deletions src/stubs/project/projectconfigurationstub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,12 @@ void ProjectConfigurationStub::setGenerateAudioTimePeriodType(GenerateAudioTimeP
{
}

muse::async::Channel<int> ProjectConfigurationStub::generateAudioTimePeriodTypeChanged() const
{
static muse::async::Channel<int> ch;
return ch;
}

int ProjectConfigurationStub::numberOfSavesToGenerateAudio() const
{
return 1;
Expand All @@ -305,6 +311,12 @@ void ProjectConfigurationStub::setNumberOfSavesToGenerateAudio(int)
{
}

muse::async::Channel<int> ProjectConfigurationStub::numberOfSavesToGenerateAudioChanged() const
{
static muse::async::Channel<int> ch;
return ch;
}

muse::io::path_t ProjectConfigurationStub::temporaryMp3FilePathTemplate() const
{
return muse::io::path_t();
Expand Down
2 changes: 2 additions & 0 deletions src/stubs/project/projectconfigurationstub.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,11 @@ class ProjectConfigurationStub : public IProjectConfiguration

GenerateAudioTimePeriodType generateAudioTimePeriodType() const override;
void setGenerateAudioTimePeriodType(GenerateAudioTimePeriodType type) override;
muse::async::Channel<int> generateAudioTimePeriodTypeChanged() const override;

int numberOfSavesToGenerateAudio() const override;
void setNumberOfSavesToGenerateAudio(int number) override;
muse::async::Channel<int> numberOfSavesToGenerateAudioChanged() const override;

muse::io::path_t temporaryMp3FilePathTemplate() const override;

Expand Down

0 comments on commit 628dfa7

Please sign in to comment.