mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-01 08:29:27 +02:00
Move GetEditClipsCanMove to global function in TracksBehaviorsPrefs.cpp
This commit is contained in:
parent
a284f57e39
commit
046ee21e72
@ -189,21 +189,6 @@ AudacityPrefs::AudacityPrefs(const wxString& appName,
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Bug 825 is essentially that SyncLock requires EditClipsCanMove.
|
|
||||||
// SyncLock needs rethinking, but meanwhile this function
|
|
||||||
// fixes the issues of Bug 825 by allowing clips to move when in
|
|
||||||
// SyncLock.
|
|
||||||
bool AudacityPrefs::GetEditClipsCanMove()
|
|
||||||
{
|
|
||||||
bool mIsSyncLocked;
|
|
||||||
gPrefs->Read(wxT("/GUI/SyncLockTracks"), &mIsSyncLocked, false);
|
|
||||||
if( mIsSyncLocked )
|
|
||||||
return true;
|
|
||||||
bool editClipsCanMove;
|
|
||||||
Read(wxT("/GUI/EditClipCanMove"), &editClipsCanMove, true);
|
|
||||||
return editClipsCanMove;
|
|
||||||
}
|
|
||||||
|
|
||||||
void InitPreferences( const wxFileName &configFileName )
|
void InitPreferences( const wxFileName &configFileName )
|
||||||
{
|
{
|
||||||
wxString appName = wxTheApp->GetAppName();
|
wxString appName = wxTheApp->GetAppName();
|
||||||
|
@ -64,7 +64,6 @@ public:
|
|||||||
const wxString& globalFilename = {},
|
const wxString& globalFilename = {},
|
||||||
long style = wxCONFIG_USE_LOCAL_FILE | wxCONFIG_USE_GLOBAL_FILE,
|
long style = wxCONFIG_USE_LOCAL_FILE | wxCONFIG_USE_GLOBAL_FILE,
|
||||||
const wxMBConv& conv = wxConvAuto());
|
const wxMBConv& conv = wxConvAuto());
|
||||||
bool GetEditClipsCanMove();
|
|
||||||
|
|
||||||
// Set and Get values of the version major/minor/micro keys in audacity.cfg when Audacity first opens
|
// Set and Get values of the version major/minor/micro keys in audacity.cfg when Audacity first opens
|
||||||
void SetVersionKeysInit( int major, int minor, int micro)
|
void SetVersionKeysInit( int major, int minor, int micro)
|
||||||
|
@ -57,6 +57,7 @@ Track classes.
|
|||||||
#include "prefs/QualityPrefs.h"
|
#include "prefs/QualityPrefs.h"
|
||||||
#include "prefs/SpectrogramSettings.h"
|
#include "prefs/SpectrogramSettings.h"
|
||||||
#include "prefs/TracksPrefs.h"
|
#include "prefs/TracksPrefs.h"
|
||||||
|
#include "prefs/TracksBehaviorsPrefs.h"
|
||||||
#include "prefs/WaveformSettings.h"
|
#include "prefs/WaveformSettings.h"
|
||||||
|
|
||||||
#include "InconsistencyException.h"
|
#include "InconsistencyException.h"
|
||||||
@ -940,7 +941,7 @@ void WaveTrack::HandleClear(double t0, double t1,
|
|||||||
if (t1 < t0)
|
if (t1 < t0)
|
||||||
THROW_INCONSISTENCY_EXCEPTION;
|
THROW_INCONSISTENCY_EXCEPTION;
|
||||||
|
|
||||||
bool editClipCanMove = gPrefs->GetEditClipsCanMove();
|
bool editClipCanMove = GetEditClipsCanMove();
|
||||||
|
|
||||||
WaveClipPointers clipsToDelete;
|
WaveClipPointers clipsToDelete;
|
||||||
WaveClipHolders clipsToAdd;
|
WaveClipHolders clipsToAdd;
|
||||||
@ -1113,7 +1114,7 @@ void WaveTrack::SyncLockAdjust(double oldT1, double newT1)
|
|||||||
void WaveTrack::Paste(double t0, const Track *src)
|
void WaveTrack::Paste(double t0, const Track *src)
|
||||||
// WEAK-GUARANTEE
|
// WEAK-GUARANTEE
|
||||||
{
|
{
|
||||||
bool editClipCanMove = gPrefs->GetEditClipsCanMove();
|
bool editClipCanMove = GetEditClipsCanMove();
|
||||||
|
|
||||||
bool bOk = src && src->TypeSwitch< bool >( [&](const WaveTrack *other) {
|
bool bOk = src && src->TypeSwitch< bool >( [&](const WaveTrack *other) {
|
||||||
|
|
||||||
@ -2356,7 +2357,7 @@ void WaveTrack::ExpandCutLine(double cutLinePosition, double* cutlineStart,
|
|||||||
double* cutlineEnd)
|
double* cutlineEnd)
|
||||||
// STRONG-GUARANTEE
|
// STRONG-GUARANTEE
|
||||||
{
|
{
|
||||||
bool editClipCanMove = gPrefs->GetEditClipsCanMove();
|
bool editClipCanMove = GetEditClipsCanMove();
|
||||||
|
|
||||||
// Find clip which contains this cut line
|
// Find clip which contains this cut line
|
||||||
double start = 0, end = 0;
|
double start = 0, end = 0;
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
#include "../Prefs.h"
|
#include "../Prefs.h"
|
||||||
#include "../ViewInfo.h"
|
#include "../ViewInfo.h"
|
||||||
#include "../WaveTrack.h"
|
#include "../WaveTrack.h"
|
||||||
|
#include "../prefs/TracksBehaviorsPrefs.h"
|
||||||
|
|
||||||
#include "TimeWarper.h"
|
#include "TimeWarper.h"
|
||||||
|
|
||||||
@ -43,7 +44,7 @@ bool Generator::Process()
|
|||||||
[&](WaveTrack *track, const Track::Fallthrough &fallthrough) {
|
[&](WaveTrack *track, const Track::Fallthrough &fallthrough) {
|
||||||
if (!track->GetSelected())
|
if (!track->GetSelected())
|
||||||
return fallthrough();
|
return fallthrough();
|
||||||
bool editClipCanMove = gPrefs->GetEditClipsCanMove();
|
bool editClipCanMove = GetEditClipsCanMove();
|
||||||
|
|
||||||
//if we can't move clips, and we're generating into an empty space,
|
//if we can't move clips, and we're generating into an empty space,
|
||||||
//make sure there's room.
|
//make sure there's room.
|
||||||
|
@ -143,3 +143,18 @@ PrefsPanel::Registration sAttachment{ "TracksBehaviors",
|
|||||||
{ "Tracks" }
|
{ "Tracks" }
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Bug 825 is essentially that SyncLock requires EditClipsCanMove.
|
||||||
|
// SyncLock needs rethinking, but meanwhile this function
|
||||||
|
// fixes the issues of Bug 825 by allowing clips to move when in
|
||||||
|
// SyncLock.
|
||||||
|
bool GetEditClipsCanMove()
|
||||||
|
{
|
||||||
|
bool mIsSyncLocked;
|
||||||
|
gPrefs->Read(wxT("/GUI/SyncLockTracks"), &mIsSyncLocked, false);
|
||||||
|
if( mIsSyncLocked )
|
||||||
|
return true;
|
||||||
|
bool editClipsCanMove;
|
||||||
|
gPrefs->Read(wxT("/GUI/EditClipCanMove"), &editClipsCanMove, true);
|
||||||
|
return editClipsCanMove;
|
||||||
|
}
|
||||||
|
@ -42,4 +42,7 @@ class TracksBehaviorsPrefs final : public PrefsPanel
|
|||||||
};
|
};
|
||||||
|
|
||||||
extern ChoiceSetting TracksBehaviorsSolo;
|
extern ChoiceSetting TracksBehaviorsSolo;
|
||||||
|
|
||||||
|
bool GetEditClipsCanMove();
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user