Ardour  9.0-pre0-582-g084a23a80d
ARDOUR::ElementImporter Class Referenceabstract

Virtual interface class for element importers. More...

#include <element_importer.h>

Inheritance diagram for ARDOUR::ElementImporter:
[legend]

Public Member Functions

 ElementImporter (XMLTree const &source, ARDOUR::Session &session)
 
virtual ~ElementImporter ()
 
virtual std::string get_name () const
 
virtual std::string get_info () const =0
 
virtual ImportStatusget_import_status ()
 
bool prepare_move ()
 
void cancel_move ()
 
void move ()
 Moves the element to the taget session. More...
 
bool broken ()
 Check if element is broken. Cannot be moved if broken. More...
 

Static Public Attributes

static PBD::Signal< std::pair< bool, std::string >std::string, std::string)> Rename
 Signal that requests for anew name. More...
 
static PBD::Signal< bool(std::string)> Prompt
 Signal for ok/cancel prompting. More...
 

Protected Member Functions

virtual void _move ()=0
 
virtual bool _prepare_move ()=0
 
virtual void _cancel_move ()=0
 Cancel move. More...
 
bool queued ()
 Ture if the element has been prepared and queued for importing. More...
 
std::string timecode_to_string (Timecode::Time &time) const
 Converts timecode time to a string. More...
 
samplecnt_t rate_convert_samples (samplecnt_t samples) const
 Converts samples so that times match the sessions sample rate. More...
 
std::string rate_convert_samples (std::string const &samples) const
 Converts samples so that times match the sessions sample rate (for straight use in XML) More...
 
void set_broken ()
 Set element broken. More...
 

Protected Attributes

XMLTree const & source
 Source XML-tree. More...
 
ARDOUR::Sessionsession
 Target session. More...
 
std::string name
 Name of element. More...
 
samplecnt_t sample_rate
 The sample rate of the session from which we are importing. More...
 

Private Attributes

bool _queued
 
bool _broken
 

Detailed Description

Virtual interface class for element importers.

Definition at line 38 of file element_importer.h.

Constructor & Destructor Documentation

◆ ElementImporter()

ARDOUR::ElementImporter::ElementImporter ( XMLTree const &  source,
ARDOUR::Session session 
)

◆ ~ElementImporter()

virtual ARDOUR::ElementImporter::~ElementImporter ( )
virtual

Member Function Documentation

◆ _cancel_move()

virtual void ARDOUR::ElementImporter::_cancel_move ( )
protectedpure virtual

◆ _move()

virtual void ARDOUR::ElementImporter::_move ( )
protectedpure virtual

Moves the element to the taget session In addition to actually adding the element to the session changing ids, renaming files etc. should be taken care of.

Implemented in ARDOUR::TempoMapImporter, ARDOUR::LocationImporter, ARDOUR::AudioTrackImporter, ARDOUR::AudioRegionImporter, and ARDOUR::AudioPlaylistImporter.

◆ _prepare_move()

virtual bool ARDOUR::ElementImporter::_prepare_move ( )
protectedpure virtual

Should take care of all tasks that need to be done before moving the element. This includes prompting the user for more information if necessary.

Returns
whether or not the element can be moved

Implemented in ARDOUR::TempoMapImporter, ARDOUR::LocationImporter, ARDOUR::AudioTrackImporter, ARDOUR::AudioRegionImporter, and ARDOUR::AudioPlaylistImporter.

◆ broken()

bool ARDOUR::ElementImporter::broken ( )
inline

Check if element is broken. Cannot be moved if broken.

Definition at line 73 of file element_importer.h.

◆ cancel_move()

void ARDOUR::ElementImporter::cancel_move ( )

Cancels moving of element If the element has been set to be moved, this cancels the move.

◆ get_import_status()

virtual ImportStatus* ARDOUR::ElementImporter::get_import_status ( )
inlinevirtual

Gets import status, if applicable.

Reimplemented in ARDOUR::AudioRegionImporter.

Definition at line 56 of file element_importer.h.

◆ get_info()

virtual std::string ARDOUR::ElementImporter::get_info ( ) const
pure virtual

Gets a textual representation of the element

Returns
a textual representation on this specific element

Implemented in ARDOUR::TempoMapImporter, ARDOUR::LocationImporter, ARDOUR::AudioTrackImporter, ARDOUR::AudioRegionImporter, and ARDOUR::AudioPlaylistImporter.

◆ get_name()

virtual std::string ARDOUR::ElementImporter::get_name ( ) const
inlinevirtual

Returns the element name

Returns
the name of the element

Definition at line 48 of file element_importer.h.

◆ move()

void ARDOUR::ElementImporter::move ( )

Moves the element to the taget session.

◆ prepare_move()

bool ARDOUR::ElementImporter::prepare_move ( )

Prepares to move element

Returns
whther or not the element could be prepared for moving

◆ queued()

bool ARDOUR::ElementImporter::queued ( )
inlineprotected

Ture if the element has been prepared and queued for importing.

Definition at line 107 of file element_importer.h.

◆ rate_convert_samples() [1/2]

samplecnt_t ARDOUR::ElementImporter::rate_convert_samples ( samplecnt_t  samples) const
protected

Converts samples so that times match the sessions sample rate.

◆ rate_convert_samples() [2/2]

std::string ARDOUR::ElementImporter::rate_convert_samples ( std::string const &  samples) const
protected

Converts samples so that times match the sessions sample rate (for straight use in XML)

◆ set_broken()

void ARDOUR::ElementImporter::set_broken ( )
inlineprotected

Set element broken.

Definition at line 125 of file element_importer.h.

◆ timecode_to_string()

std::string ARDOUR::ElementImporter::timecode_to_string ( Timecode::Time time) const
protected

Converts timecode time to a string.

Member Data Documentation

◆ _broken

bool ARDOUR::ElementImporter::_broken
private

Definition at line 129 of file element_importer.h.

◆ _queued

bool ARDOUR::ElementImporter::_queued
private

Definition at line 128 of file element_importer.h.

◆ name

std::string ARDOUR::ElementImporter::name
protected

Name of element.

Definition at line 110 of file element_importer.h.

◆ Prompt

PBD::Signal<bool(std::string)> ARDOUR::ElementImporter::Prompt
static

Signal for ok/cancel prompting.

Definition at line 79 of file element_importer.h.

◆ Rename

PBD::Signal<std::pair<bool, std::string>std::string, std::string)> ARDOUR::ElementImporter::Rename
static

Signal that requests for anew name.

Definition at line 76 of file element_importer.h.

◆ sample_rate

samplecnt_t ARDOUR::ElementImporter::sample_rate
protected

The sample rate of the session from which we are importing.

Definition at line 113 of file element_importer.h.

◆ session

ARDOUR::Session& ARDOUR::ElementImporter::session
protected

Target session.

Definition at line 104 of file element_importer.h.

◆ source

XMLTree const& ARDOUR::ElementImporter::source
protected

Source XML-tree.

Definition at line 101 of file element_importer.h.


The documentation for this class was generated from the following file: