1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-09-24 16:01:16 +02:00

Always apply commands to the active project. (introduced for the eutychus plugin, see discussion on audacity-devel)

This commit is contained in:
james.k.crook@gmail.com 2013-12-16 21:24:21 +00:00
parent d60b249653
commit 2cab0679a5

View File

@ -42,6 +42,11 @@ void CommandHandler::OnReceiveCommand(AppCommandEvent &event)
// First retrieve the actual command from the event 'envelope'.
Command *cmd = event.GetCommand();
// JKC: In case the user changed the project, let us track that.
// This saves us the embarrassment (crash) of a new project
// being opened, the old one closed and still trying to act
// on the old one.
SetProject( GetActiveProject() );
// Then apply it to current application & project. Note that the
// command may change the context - for example, switching to a
// different project.