1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-28 08:10:11 +01:00

Merge branch 'dafixes' into darkaudacity

Conflicts:
	src/AboutDialog.cpp
	src/HelpText.cpp
	src/ViewInfo.cpp
	src/toolbars/ControlToolBar.cpp
This commit is contained in:
James Crook
2016-09-10 21:49:37 +01:00
7 changed files with 38 additions and 25 deletions

View File

@@ -50,6 +50,7 @@
// enables dark theme and customisations.
#define EXPERIMENTAL_DARK_AUDACITY
#define EXPERIMENTAL_DA
// experimental theming
// Work in progress, June-2008.

View File

@@ -199,6 +199,9 @@ const int sbarHjump = 30; //STM: This is how far the thumb jumps when the
#include "AllThemeResources.h"
#endif
int AudacityProject::mProjectCounter=0;// global counter.
////////////////////////////////////////////////////////////
/// Custom events
////////////////////////////////////////////////////////////
@@ -890,6 +893,7 @@ AudacityProject::AudacityProject(wxWindow * parent, wxWindowID id,
// field. Currently there are no such help strings, but it they were introduced, then
// there would need to be an event handler to send them to the appropriate field.
mStatusBar = CreateStatusBar(4);
mProjectNo = mProjectCounter++; // Bug 322
wxGetApp().SetMissingAliasedFileWarningShouldShow(true);
@@ -2016,17 +2020,6 @@ void AudacityProject::HandleResize()
UpdateLayout();
}
// What number is this project?
int AudacityProject::GetProjectNumber()
{
int i;
for(i=0;i<gAudacityProjects.size();i++){
if(gAudacityProjects[i].get() == this )
return i;
}
return -1;
}
// How many projects that do not have a name yet?
int AudacityProject::CountUnnamed()
{
@@ -2046,7 +2039,9 @@ void AudacityProject::RefreshAllTitles(bool bShowProjectNumbers )
for(i=0;i<gAudacityProjects.size();i++){
if(gAudacityProjects[i]){
if( !gAudacityProjects[i]->mIconized ){
gAudacityProjects[i]->SetProjectTitle( bShowProjectNumbers ? i : -1 );
AudacityProject * p;
p = gAudacityProjects[i].get();
p->SetProjectTitle( bShowProjectNumbers ? p->GetProjectNumber() : -1 );
}
}
}
@@ -2372,6 +2367,10 @@ void AudacityProject::OnMouseEvent(wxMouseEvent & event)
class TitleRestorer{
public:
TitleRestorer(AudacityProject * p ){
if( p->IsIconized() )
p->Restore();
p->Raise(); // May help identifying the window on Mac
// Construct this projects name and number.
sProjNumber = "";
sProjName = p->GetName();

View File

@@ -341,7 +341,7 @@ class AUDACITY_DLL_API AudacityProject final : public wxFrame,
static TrackList *GetClipboardTracks();
static void DeleteClipboard();
int GetProjectNumber();
int GetProjectNumber(){ return mProjectNo;};
static int CountUnnamed();
static void RefreshAllTitles(bool bShowProjectNumbers );
// checkActive is a temporary hack that should be removed as soon as we
@@ -522,6 +522,7 @@ public:
void PushState(const wxString &desc, const wxString &shortDesc, UndoPush flags);
void RollbackState();
private:
void OnCapture(wxCommandEvent & evt);
@@ -550,6 +551,9 @@ public:
bool mbLoadedFromAup;
std::shared_ptr<DirManager> mDirManager; // MM: DirManager now created dynamically
static int mProjectCounter;// global counter.
int mProjectNo; // count when this project was created.
double mRate;
sampleFormat mDefaultFormat;

View File

@@ -90,6 +90,7 @@ bool ZoomInfo::ZoomOutAvailable() const
void ZoomInfo::SetZoom(double pixelsPerSecond)
{
zoom = std::max(gMinZoom, std::min(gMaxZoom, pixelsPerSecond));
#ifdef EXPERIMENTAL_DA
// Disable snapping if user zooms in a long way.
// Helps stop users be trapped in snap-to.
// The level chosen is in sample viewing range with samples
@@ -100,6 +101,7 @@ void ZoomInfo::SetZoom(double pixelsPerSecond)
if( project )
project->OnSnapToOff();
}
#endif
}
void ZoomInfo::ZoomBy(double multiplier)

View File

@@ -174,7 +174,6 @@ public:
wxFileName GetAutoExportFileName();
private:
bool ExamineTracks();
bool GetFilename();
bool CheckFilename();

View File

@@ -886,6 +886,14 @@ int ExportMultiple::ExportMultipleByTrack(bool byName,
continue;
}
// Bug 1510 possibly increment iter, before deciding whether to export.
// Check for a linked track
tr2 = NULL;
if (tr->GetLinked()) {
tr2 = iter.Next();
}
wxLogDebug( "Get setting %i", count );
/* get the settings to use for the export from the array */
activeSetting = exportSettings[count];
if( activeSetting.destfile.GetName().IsEmpty() ){
@@ -895,15 +903,9 @@ int ExportMultiple::ExportMultipleByTrack(bool byName,
/* Select the track */
tr->SetSelected(true);
// Check for a linked track
tr2 = NULL;
if (tr->GetLinked()) {
tr2 = iter.Next();
if (tr2) {
// Select it also
tr2->SetSelected(true);
}
if (tr2) {
// Select it also
tr2->SetSelected(true);
}
// Export the data. "channels" are per track.

View File

@@ -223,8 +223,12 @@ void ControlToolBar::RegenerateTooltips()
break;
case ID_RECORD_BUTTON:
commands.push_back(wxT("Record"));
#ifndef EXPERIMENTAL_DA
commands.push_back(wxT("RecordBelow"));
#else
commands.push_back(_("Record Below"));
commands.push_back(wxT("RecordBelow"));
#endif
break;
case ID_PAUSE_BUTTON:
commands.push_back(wxT("Pause"));
@@ -875,12 +879,14 @@ void ControlToolBar::OnRecord(wxCommandEvent &evt)
if (p) {
TrackList *trackList = p->GetTracks();
TrackListIterator it(trackList);
bool shifted = mRecord->WasShiftDown();
#ifdef EXPERIMENTAL_DARK_AUDACITY
#ifdef EXPERIMENTAL_DA
shifted = !shifted;
#endif
if(it.First() == NULL)
shifted = false;
double t0 = p->GetSel0();
double t1 = p->GetSel1();
if (t1 == t0)
@@ -981,7 +987,7 @@ void ControlToolBar::OnRecord(wxCommandEvent &evt)
else {
bool recordingNameCustom, useTrackNumber, useDateStamp, useTimeStamp;
wxString defaultTrackName, defaultRecordingTrackName;
// Count the tracks.
int numTracks = 0;