mirror of
https://github.com/cookiengineer/audacity
synced 2025-05-04 17:49:45 +02:00
... in many places where the function call will later need to be between modules (or libraries, or the executable) and the annotation will be a necessity to keep the linkage working on Windows. That's all that this sweeping commit does.
60 lines
1.2 KiB
C++
60 lines
1.2 KiB
C++
/**********************************************************************
|
|
|
|
Audacity: A Digital Audio Editor
|
|
|
|
Clipboard.h
|
|
|
|
Paul Licameli
|
|
|
|
**********************************************************************/
|
|
|
|
#ifndef __AUDACITY_CLIPBOARD__
|
|
#define __AUDACITY_CLIPBOARD__
|
|
|
|
|
|
|
|
#include <memory>
|
|
#include <wx/event.h> // to inherit wxEvtHandler
|
|
|
|
class AudacityProject;
|
|
class TrackList;
|
|
|
|
// An event emitted by the clipboard whenever its contents change.
|
|
wxDECLARE_EXPORTED_EVENT( AUDACITY_DLL_API,
|
|
EVT_CLIPBOARD_CHANGE, wxCommandEvent );
|
|
|
|
class AUDACITY_DLL_API Clipboard final
|
|
: public wxEvtHandler
|
|
{
|
|
public:
|
|
static Clipboard &Get();
|
|
|
|
const TrackList &GetTracks() const;
|
|
|
|
double T0() const { return mT0; }
|
|
double T1() const { return mT1; }
|
|
double Duration() const { return mT1 - mT0; }
|
|
|
|
const std::weak_ptr<AudacityProject> &Project() const { return mProject; }
|
|
|
|
void Clear();
|
|
|
|
void Assign(
|
|
TrackList && newContents, double t0, double t1,
|
|
const std::weak_ptr<AudacityProject> &pProject );
|
|
|
|
Clipboard();
|
|
~Clipboard();
|
|
|
|
void Swap( Clipboard &other );
|
|
|
|
private:
|
|
|
|
std::shared_ptr<TrackList> mTracks;
|
|
std::weak_ptr<AudacityProject> mProject{};
|
|
double mT0{ 0 };
|
|
double mT1{ 0 };
|
|
};
|
|
|
|
#endif
|