Beispiel #1
0
CopyCommand::CopyCommand(EventSelection &selection,
                         Clipboard *clipboard) :
        NamedCommand(getGlobalName()),
        m_targetClipboard(clipboard)
{
    m_sourceClipboard = new Clipboard;
    m_savedClipboard = 0;
    std::string label = selection.getSegment().getLabel();
    m_sourceClipboard->newSegment(&selection)->setLabel(
            appendLabel(label, qstrtostr(tr("(excerpt)"))));
}
Beispiel #2
0
CutCommand::CutCommand(SegmentSelection &selection,
                       Clipboard *clipboard) :
        MacroCommand(getGlobalName())
{
    addCommand(new CopyCommand(selection, clipboard));

    for (SegmentSelection::iterator i = selection.begin();
            i != selection.end(); ++i) {
        addCommand(new SegmentEraseCommand(*i));
    }
}
Beispiel #3
0
AddTracksCommand::AddTracksCommand(Composition *composition,
                                   unsigned int nbTracks,
                                   InstrumentId id,
                                   int position):
    NamedCommand(getGlobalName()),
    m_composition(composition),
    m_nbNewTracks(nbTracks),
    m_instrumentId(id),
    m_position(position),
    m_detached(false)

{
}
RemoveMarkerCommand::RemoveMarkerCommand(Composition *comp,
        int id,
        timeT time,
        const std::string &name,
        const std::string &description):
        NamedCommand(getGlobalName()),
        m_composition(comp),
        m_marker(0),
        m_id(id),
        m_time(time),
        m_name(name),
        m_descr(description),
        m_detached(false)
{}
ChangeCompositionLengthCommand::ChangeCompositionLengthCommand(
    Composition *composition,
    timeT startTime,
    timeT endTime,
    bool autoExpand):
        NamedCommand(getGlobalName()),
        m_composition(composition),
        m_startTime(startTime),
        m_endTime(endTime),
        m_autoExpand(autoExpand),
        m_oldStartTime(m_composition->getStartMarker()),
        m_oldEndTime(m_composition->getEndMarker()),
        m_oldAutoExpand(m_composition->autoExpandEnabled())
{}
SegmentJoinCommand::SegmentJoinCommand(SegmentSelection &segments) :
        NamedCommand(getGlobalName()),
        m_newSegment(0),
        m_detached(false) // true if the old segments are detached, not the new
{
    for (SegmentSelection::iterator i = segments.begin();
            i != segments.end(); ++i)
    {
        m_oldSegments.push_back(*i);
    }

    Q_ASSERT_X(!m_oldSegments.empty(),
            "SegmentJoinCommand::SegmentJoinCommand()",
            "No segments to join");
}
Beispiel #7
0
CopyCommand::CopyCommand(SegmentSelection &selection,
                         Clipboard *clipboard) :
        NamedCommand(getGlobalName()),
        m_targetClipboard(clipboard)
{
    m_sourceClipboard = new Clipboard;
    m_savedClipboard = 0;

    for (SegmentSelection::iterator i = selection.begin();
            i != selection.end(); ++i) {
        std::string label = (*i)->getLabel();
        m_sourceClipboard->newSegment(*i)->setLabel(
                appendLabel(label, qstrtostr(tr("(copied)"))));
    }
}
ModifyMarkerCommand::ModifyMarkerCommand(Composition *comp,
        int id,
        timeT time,
        timeT newTime,
        const std::string &name,
        const std::string &des):
        NamedCommand(getGlobalName()),
        m_composition(comp),
        m_time(time),
        m_newTime(newTime),
        m_id(id),
        m_name(name),
        m_description(des),
        m_oldName(""),
        m_oldDescription("")
{}
AudioSegmentRescaleCommand::AudioSegmentRescaleCommand(RosegardenDocument *doc,
                                                       Segment *s,
						       float ratio) :
    NamedCommand(getGlobalName()),
    m_afm(&doc->getAudioFileManager()),
    m_stretcher(new AudioFileTimeStretcher(m_afm)),
    m_segment(s),
    m_newSegment(0),
    m_timesGiven(false),
    m_startTime(0),
    m_endMarkerTime(0),
    m_fid(-1),
    m_ratio(ratio),
    m_detached(false)
{
    // nothing
}
AddIndicationCommand::AddIndicationCommand(std::string indicationType,
                                           EventSelection &selection) :
    BasicCommand(getGlobalName(indicationType),
                 selection.getSegment(),
                 std::min(selection.getStartTime(), selection.getNotationStartTime()),
                 std::max(selection.getEndTime(), selection.getNotationEndTime())),
    m_indicationType(indicationType),
    m_indicationStart(selection.getNotationStartTime()),
    m_indicationDuration(selection.getTotalNotationDuration()),
    m_lastInsertedEvent(0)
{
    if (!canExecute()) {
        throw CommandFailed
            //!!! need to use text from trunk/src/gui/editors/notation/NotationView.cpp (but this requires an informal human-readable version of the indication name)
            (qstrtostr(tr("Can't add identical overlapping indications")));
    }
}
Beispiel #11
0
ModifyDeviceCommand::ModifyDeviceCommand(
    Studio *studio,
    DeviceId device,
    const std::string &name,
    const std::string &librarianName,
    const std::string &librarianEmail) :
        NamedCommand(getGlobalName()),
        m_studio(studio),
        m_device(device),
        m_name(name),
        m_librarianName(librarianName),
        m_librarianEmail(librarianEmail),
        m_overwrite(true),
        m_rename(true),
        m_changeVariation(false),
        m_changeBanks(false),
        m_changePrograms(false),
        m_changeControls(false),
        m_changeKeyMappings(false),
        m_clearBankAndProgramList(false)
{}
CreateOrDeleteDeviceCommand::CreateOrDeleteDeviceCommand(Studio *studio,
                                                         DeviceId id) :
    NamedCommand(getGlobalName(true)),
    m_studio(studio),
    m_deviceId(id),
    m_deviceCreated(true)
{
    Device *device = m_studio->getDevice(m_deviceId);

    if (device) {
        m_name = device->getName();
        m_type = device->getType();
        m_direction = MidiDevice::Play;
        MidiDevice *md = dynamic_cast<MidiDevice *>(device);
        if (md) m_direction = md->getDirection();
        m_connection = qstrtostr(RosegardenSequencer::getInstance()
                                 ->getConnection(md->getId()));
    } else {
        RG_DEBUG << "CreateOrDeleteDeviceCommand: No such device as "
                 << m_deviceId << endl;
    }
}
SegmentChangeQuantizationCommand::SegmentChangeQuantizationCommand(timeT unit) :
        NamedCommand(getGlobalName(unit)),
        m_unit(unit)
{
    // nothing
}
SelectionPropertyCommand::SelectionPropertyCommand(ParameterPattern::Result result):
        BasicSelectionCommand(getGlobalName(), 
                              *(result.getSelection()),
                              true),
        m_result(result)
{}
SegmentAutoSplitCommand::SegmentAutoSplitCommand(Segment *segment) :
        NamedCommand(getGlobalName()),
        m_segment(segment),
        m_composition(segment->getComposition()),
        m_detached(false)
{}
Beispiel #16
0
std::string MultiplexNetwork::getGlobalName(const std::string& local_vertex_name, const std::string& network_name) const {
	network_id net = getNetworkId(network_name);
	vertex_id local_id = getNetwork(net).getVertexId(local_vertex_name);
	global_identity global_id = getGlobalIdentity(local_id, net);
	return getGlobalName(global_id);
}