1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-21 06:01:13 +02:00

New files for ProjectSelectionManager

This commit is contained in:
Paul Licameli
2019-06-09 07:42:40 -04:00
parent 186f2f6ac7
commit 997bf9781d
13 changed files with 365 additions and 287 deletions

View File

@@ -0,0 +1,58 @@
/**********************************************************************
Audacity: A Digital Audio Editor
ProjectSelectionManager.cpp
Paul Licameli split from ProjectManager.cpp
**********************************************************************/
#ifndef __AUDACITY_PROJECT_SELECTION_MANAGER__
#define __AUDACITY_PROJECT_SELECTION_MANAGER__
#include "ClientData.h" // to inherit
#include "toolbars/SelectionBarListener.h" // to inherit
#include "toolbars/SpectralSelectionBarListener.h" // to inherit
class AudacityProject;
class ProjectSelectionManager final
: public ClientData::Base
, public SelectionBarListener
, public SpectralSelectionBarListener
{
public:
static ProjectSelectionManager &Get( AudacityProject &project );
static const ProjectSelectionManager &Get( const AudacityProject &project );
explicit ProjectSelectionManager( AudacityProject &project );
~ProjectSelectionManager() override;
// SelectionBarListener callback methods
double AS_GetRate() override;
void AS_SetRate(double rate) override;
int AS_GetSnapTo() override;
void AS_SetSnapTo(int snap) override;
const NumericFormatSymbol & AS_GetSelectionFormat() override;
void AS_SetSelectionFormat(const NumericFormatSymbol & format) override;
void AS_ModifySelection(double &start, double &end, bool done) override;
// SpectralSelectionBarListener callback methods
double SSBL_GetRate() const override;
const NumericFormatSymbol & SSBL_GetFrequencySelectionFormatName() override;
void SSBL_SetFrequencySelectionFormatName(
const NumericFormatSymbol & formatName) override;
const NumericFormatSymbol & SSBL_GetBandwidthSelectionFormatName() override;
void SSBL_SetBandwidthSelectionFormatName(
const NumericFormatSymbol & formatName) override;
void SSBL_ModifySpectralSelection(
double &bottom, double &top, bool done) override;
private:
bool SnapSelection();
AudacityProject &mProject;
};
#endif