rosegardensequenceriface.h

// -*- c-indentation-style:"stroustrup" c-basic-offset: 4 -*-/* Rosegarden-4 A sequencer and musical notation editor. This program is Copyright 2000-2006 Guillaume Laurent <glaurent@telegraph-road.org>, Chris Cannam <cannam@all-day-breakfast.com>, Richard Bown <bownie@bownie.com> The moral right of the authors to claim authorship of this work has been asserted. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. See the file COPYING included with this distribution for more information.*/#ifndef _ROSEGARDENSEQUENCERIFACE_H_#define _ROSEGARDENSEQUENCERIFACE_H_#include <dcopobject.h>// #include <qvaluevector.h>// #include <qpair.h>#include "rosegardendcop.h"#include "Event.h"#include "MappedComposition.h"#include "MappedEvent.h"#include "Instrument.h"#include "MappedDevice.h"#include "MappedRealTime.h"#include "MappedStudio.h"#include "MappedCommon.h"class RosegardenSequencerIface : virtualpublic DCOPObject
{
K_DCOP
public:
k_dcop:
// close the sequencer//virtualvoid quit() = 0;
// play from a given time with given parameters//virtualint play(long timeSec,
long timeNsec,
long readAheadSec,
long readAheadNsec,
long audioMixSec,
long audioMixNsec,
long audioReadSec,
long audioReadNsec,
long audioWriteSec,
long audioWriteNsec,
long smallFileSize) = 0;
// record from a given time with given parameters//virtualint record(long timeSec,
long timeNsec,
long readAheadSec,
long readAheadNsec,
long audioMixSec,
long audioMixNsec,
long audioReadSec,
long audioReadNsec,
long audioWriteSec,
long audioWriteNsec,
long smallFileSize,
long recordMode) = 0;
// stop the sequencer//virtual ASYNC stop() = 0;
// punch out from recording to playback//virtualint punchOut() = 0;
// Set the sequencer to a given time//virtualvoid jumpTo(long posSec, long posNsec) = 0;
// Set a loop on the sequencer//virtualvoid setLoop(long loopStartSec,
long loopStartNsec,
long loopEndSec,
long loopEndNsec) = 0;
// Get the status of the Sequencer//virtualunsignedint getSoundDriverStatus(const QString &guiVersion) = 0;
// Add and delete audio files on the Sequencer//virtualint addAudioFile(const QString &fileName, intid) = 0;
virtualint removeAudioFile(intid) = 0;
virtualvoid clearAllAudioFiles() = 0;
// Single set function as the MappedInstrument is so lightweight.// Any mods on the GUI are sent only through this method.//virtualvoid setMappedInstrument(int type,
unsignedchar channel,
unsignedintid) = 0;
// The GUI can use this method to process an immediate selection// of MappedEvents (Program Changes, SysExs, async Events etc).//virtualvoid processSequencerSlice(Rosegarden::MappedComposition mC) = 0;
// Horrible ugly ugly ugly interface for single MappedEvents// just until we implement the proper MappedEvent interface//virtualvoid processMappedEvent(unsignedintid,
int type,
unsignedchar pitch,
unsignedchar velocity,
long absTimeSec,
long absTimeNsec,
long durationSec,
long durationNsec,
long audioStartMarkerSec,
long audioStartMarkerNsec) = 0;
// The proper implementation//virtualvoid processMappedEvent(Rosegarden::MappedEvent mE) = 0;
// Return device id following last existing one -- you can treat// this as "number of devices" but there might be some holes if// devices were deleted, which you will recognise because// getMappedDevice(id) will return a device with id NO_DEVICE//virtualunsignedint getDevices() = 0;
// Return device by number//virtual Rosegarden::MappedDevice getMappedDevice(unsignedintid) = 0;
// Query whether the driver implements device reconnection.// Returns a non-zero value if the addDevice, removeDevice,// getConnections, getConnection and setConnection methods// may be used with devices of the given type.//virtualint canReconnect(int deviceType) = 0;
// Create a device of the given type and direction (corresponding// to MidiDevice::DeviceDirection enum) and return its id.// The device will have no connection by default. Direction is// currently ignored for non-MIDI devices.// Do not use this unless canReconnect(type) returned true.//virtualunsignedint addDevice(int type, unsignedint direction) = 0;
// Remove the device of the given id.// Ignored if driver does not permit changing the number of devices// (i.e. if canReconnect(type) would return false when given the// type of the supplied device).//virtualvoid removeDevice(unsignedintid) = 0;
// Rename the given device.// Ignored if the driver does not permit this operation.//virtualvoid renameDevice(unsignedintid, QString name) = 0;
// Return the number of permissible connections for a device of// the given type and direction (corresponding to MidiDevice::// DeviceDirection enum). Direction is ignored for non-MIDI devices.// Returns zero if devices of this type are non-reconnectable// (i.e. if canReconnect(type) would return false).//virtualunsignedint getConnections(int type, unsignedint direction) = 0;
// Return one of the set of permissible connections for a device of// the given type and direction (corresponding to MidiDevice::// DeviceDirection enum). Direction is ignored for non-MIDI devices.// Returns the empty string for invalid parameters.// virtual QString getConnection(int type,
unsignedint direction,
unsignedint connectionNo) = 0;
// Reconnect a particular device.// Ignored if driver does not permit reconnections or the connection// is not one of the permissible set for that device.// virtualvoid setConnection(unsignedint deviceId, QString connection) = 0;
// Reconnect a device to a particular connection or to the closest// thing to that connection currently available (using some heuristic).// Ignored if driver does not permit reconnections.// virtualvoid setPlausibleConnection(unsignedint deviceId,
QString idealConnection) = 0;
// Return the number of different timers we are capable of// sychronising against. This may return 0 if the driver has no// ability to change the current timer.//virtualunsignedint getTimers() = 0;
// Return the name of a timer from the available set (where// n is between 0 and the return value from getTimers() - 1).//virtual QString getTimer(unsignedint n) = 0;
// Return the name of the timer we are currently synchronising// against.// virtual QString getCurrentTimer() = 0;
// Set the timer we are currently synchronising against.// Invalid arguments are simply ignored.//virtualvoid setCurrentTimer(QString timer) = 0;
virtualvoid setLowLatencyMode(bool lowLatMode) = 0;
// Fetch audio play latencies//virtual Rosegarden::MappedRealTime getAudioPlayLatency() = 0;
virtual Rosegarden::MappedRealTime getAudioRecordLatency() = 0;
// Set a property on a MappedObject//virtualvoid setMappedProperty(intid,
const QString &property,
float value) = 0;
// Set many properties on many MappedObjects//virtualvoid setMappedProperties(const Rosegarden::MappedObjectIdList &ids,
const Rosegarden::MappedObjectPropertyList &properties,
const Rosegarden::MappedObjectValueList &values) = 0;
// Set a string property on a MappedObject//virtualvoid setMappedProperty(intid,
const QString &property,
const QString &value) = 0;
// Set a MappedObject to a property list//virtualvoid setMappedPropertyList(
intid,
const QString &property,
const Rosegarden::MappedObjectPropertyList &values) = 0;
// Get a mapped object id for a object type//virtualint getMappedObjectId(int type) = 0;
// Get a list of properties of a certain type from an object//virtual std::vector<QString> getPropertyList(intid,
const QString &property) = 0;
// Get a list of available plugins//virtual std::vector<QString> getPluginInformation() = 0;
// Nasty hack: program name/number mappings are one thing that// mapped object properties can't cope with//virtual QString getPluginProgram(int mappedId, int bank, int program) = 0;
// Nastier hack: return value is bank << 16 + program//virtualunsignedlong getPluginProgram(int mappedId, const QString &name) = 0;
// Cheat - we can't use a call (getPropertyList) during playback// so we use this method to set port N on plugin X.//virtualvoid setMappedPort(int pluginIn,
unsignedlongid,
float value) = 0;
virtualfloat getMappedPort(int pluginIn,
unsignedlongid) = 0;
// Create a (transient, writeable) object//virtualint createMappedObject(int type) = 0;
// Destroy an object (returns a bool but for KDE2 DCOP compat we// use an int of course).//virtualint destroyMappedObject(intid) = 0;
// Connect two objects//virtualvoid connectMappedObjects(int id1, int id2) = 0;
// Disconnect two objects//virtualvoid disconnectMappedObjects(int id1, int id2) = 0;
// Disconnect an object from everything//virtualvoid disconnectMappedObject(intid) = 0;
// Driver sample rate//virtualunsignedint getSampleRate() const = 0;
// Initialise/Reinitialise the studio back down to read only objects// and set to defaults.//virtualvoid clearStudio() = 0;
// Allow the GUI to tell the sequence the duration of a quarter// note when the TEMPO changes - this is to allow the sequencer// to generate MIDI clock (at 24 PPQN).//virtualvoid setQuarterNoteLength(long timeSec, long timeNsec) = 0;
// Return a (potentially lengthy) human-readable status log//virtual QString getStatusLog() = 0;
// Debug stuff, to check MmappedSegment::iteratorvirtualvoid dumpFirstSegment() = 0;
/// Remap a segment while playingvirtualvoid remapSegment(const QString& filename, size_t newSize) = 0;
/// Add a segment while playingvirtualvoid addSegment(const QString& filename) = 0;
/// Delete a segment while playingvirtualvoid deleteSegment(const QString& filename) = 0;
/// Close all mmapped segmentsvirtualvoid closeAllSegments() = 0;
/** Update mute (etc) statuses while playing. The sequencer handles this automatically (with no need for this call) for MIDI events, but it needs to be prodded when an already-playing audio segment drops in or out. */virtualvoid remapTracks() = 0;
};
#endif // _ROSEGARDENSEQUENCERIFACE_H_