|
Canorus 0.0
|
Resource control class. More...
#include <resourcectl.h>
Public Member Functions | |
| CAResourceCtl () | |
| virtual | ~CAResourceCtl () |
Static Public Member Functions | |
| static CAResource * | importResource (QString name, QString fileName, bool isLinked=false, CADocument *parent=0, CAResource::CAResourceType t=CAResource::Other) |
| static CAResource * | createEmptyResource (QString name, CADocument *parent=0, CAResource::CAResourceType t=CAResource::Other) |
| static void | deleteResource (CAResource *) |
Resource control class.
Copyright (c) 2008-2009, Matevž Jekovec, Canorus development team All Rights Reserved. See AUTHORS for a complete list of authors.
Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE.GPL for details.
Copyright (c) 2008-2009, Matevž Jekovec, Canorus development team All Rights Reserved. See AUTHORS for a complete list of authors.
Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE.GPL for details.
This class is used for creation of new resources out of files on the disk or web URLs.
Resources are rarely created directly (maybe using the plugin interface), but usually are part of the document (eg. audio file of the whole score), sheet (eg. audio file of a theme), staff (eg. svg images in contemporary music), voice etc. You can simply add a resource by calling CADocument::addResource( new CAResource( "/home/user/title.jpeg", "My image") );
CAResourceContainer takes care of creating copies for non-linked resources. It picks a random unique name for a new resource in the system temporary file.
| CAResourceCtl::CAResourceCtl | ( | ) |
Default constructor. Currently empty.
|
virtual |
|
static |
Creates an empty resource file. This function is usually called when launching Midi recorder.
References CADocument::addResource(), CAResource::document(), CAUndo::getAllDocuments(), CADocument::setModified(), and CACanorus::undo().
Referenced by CAMainWin::on_uiMidiRecorder_triggered().


|
static |
Removes the given resource r from all the undo/redo document instances and destroys it.
References CAResource::document(), CAUndo::getAllDocuments(), CADocument::removeResource(), CADocument::setModified(), and CACanorus::undo().
Referenced by CADocument::clear(), and CAResourceView::contextMenuEvent().


|
static |
Imports the resource located at fileName and adds it to the document parent and all its undo/redo instances. If the resource is linked, the fileName should be url and a resource is only registered. If the resource is not linked, the fileName should be absolute path to the file, resource is copied and registered.
References CADocument::addResource(), CAUndo::getAllDocuments(), and CACanorus::undo().
Referenced by CACanorusMLImport::importResource().

