Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/ProjectMWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,13 @@ std::string ProjectMWrapper::ProjectMRuntimeVersion()
return projectMRuntimeVersion;
}

void ProjectMWrapper::PresetFileNameToClipboard() const
{
auto presetName = projectm_playlist_item(_playlist, projectm_playlist_get_position(_playlist));
SDL_SetClipboardText(presetName);
projectm_playlist_free_string(presetName);
}

void ProjectMWrapper::PresetSwitchedEvent(bool isHardCut, unsigned int index, void* context)
{
auto that = reinterpret_cast<ProjectMWrapper*>(context);
Expand Down
5 changes: 5 additions & 0 deletions src/ProjectMWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ class ProjectMWrapper : public Poco::Util::Subsystem
*/
std::string ProjectMRuntimeVersion();

/**
* Copies the full path of the current preset into the OS clipboard.
*/
void PresetFileNameToClipboard() const;

private:
/**
* @brief projectM callback. Called whenever a preset is switched.
Expand Down
7 changes: 7 additions & 0 deletions src/RenderLoop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,13 @@ void RenderLoop::KeyEvent(const SDL_KeyboardEvent& event, bool down)
}
break;

case SDLK_c:
if (modifierPressed)
{
_projectMWrapper.PresetFileNameToClipboard();
}
break;

#ifdef _DEBUG
case SDLK_d:
// Write next rendered frame to file
Expand Down
3 changes: 2 additions & 1 deletion src/gui/HelpWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,5 +167,6 @@ void HelpWindow::FillKeyboardShortcutsTable()
{"Increase Beat Sensitivity by 1%", "Cursor Up"},
{"Decrease Beat Sensitivity by 1%", "Cursor Down"},
{"Add Random Waveform at Mouse Pointer", "Shift+Left Mouse"},
{"Clear Random Waveforms", "Middle Mouse"}};
{"Clear Random Waveforms", "Middle Mouse"},
{"Copy Current Preset Path to Clipboard", "Ctrl-c"}};
}
7 changes: 7 additions & 0 deletions src/gui/MainMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@ void MainMenu::Draw()
_notificationCenter.postNotification(new PlaybackControlNotification(PlaybackControlNotification::Action::ToggleShuffle));
}

ImGui::Separator();

if (ImGui::MenuItem("Copy Current Preset Filename", "Ctrl+c"))
{
_projectMWrapper.PresetFileNameToClipboard();
}

ImGui::EndMenu();
}

Expand Down
Loading