![]() |
Moo
|
#include <mooprojects.h>
Public Types | |
enum | { kProjectsChanged = 3000, kProjectChanged, kProjectAdded, kProjectRemoved, kProjectOpened, kProjectClosed, kProjectSynced, kProjectTrackAdded, kProjectTrackRemoved, kProjectClipAdded, kProjectClipRemoved, kProjectMessage, kMooProjectsErrorNotLoggedIn = 3000, kMooProjectsErrorNotAmember, kMooProjectsErrorProjectNotFound } |
asynchronous operations as passed to the operation parameter for the callback More... | |
Public Member Functions | |
virtual MooProject ** | getProjects (mooInt &count)=0 |
obtain a list of all projects that the currently logged in user is part of. More... | |
virtual MooProject * | getProject (mooUInt id)=0 |
get a specific project by id | |
virtual mooUInt | createProject (const mooChar *projectName)=0 |
create a project. The callback will be notified whenever changes to a successfully opened project are beeing made. More... | |
virtual mooInt | openProject (mooUInt id)=0 |
open a project. The callback will be notified whenever changes to a successfully opened project are beeing made. More... | |
virtual void | closeProject ()=0 |
close the currently opened project | |
virtual void | syncProject ()=0 |
sync with cloud More... | |
virtual mooUInt | getActiveProjectID ()=0 |
get the currently opened project. if none is open, 0 is returned | |
virtual void | setCallback (mooProjectsCallback callback, void *reference)=0 |
the reference parameter passed to setCallback is passed to the callback for your own use, Moo does not touch this. More... | |
anonymous enum |
asynchronous operations as passed to the operation parameter for the callback
Enumerator | |
---|---|
kProjectSynced | sync completed |
kProjectMessage | with project member id, result is message ID, see MooProject getMessage () |
kMooProjectsErrorNotLoggedIn | error codes passed to callback |
create a project. The callback will be notified whenever changes to a successfully opened project are beeing made.
note that you can only create a new project if you have sufficient quota to do so. This depends on the users' account, webspace etc returns the project unique ID as with all moo objects. No project of this user with the same name must exist and sufficient account resources must be given, otherwise 0 will be returned which is always an invalid ID. the project will be opened and a curruntly opened project will be closed beforehand even if create fails.
|
pure virtual |
obtain a list of all projects that the currently logged in user is part of.
Note that members of the MooProject array may be null, which happens when a project becomes deleted. this also means that the returned count value includes removed projects (which are null in the list). It may also happen from outside, then your callback is beeing invoked. This ensures that list indices are never changed. accordingly, new projects may have been added which possibly increases the size of the list (count parameter). the list is first populated when the user is successfully logged in, otherwise NULL is returned. note that the list may change dynamically, for instance when you are beeing invited to a project. In that case, your callback will be invoked, so you should call getProjects once after login, and then in you callback to refresh your own representation. See MooProject for further actions on projects returned in this list.
open a project. The callback will be notified whenever changes to a successfully opened project are beeing made.
Only one project can be open at any time. If another project is already open, it will be closed. only the activated project can sync to the cloud. MOO_OK will be returned if all goes well or the project is already opened, else check error code. if the user is not a member of the project, kMooProjectsErrorNotAmember will be returned. this is a synchronous operation. It may take a while to download and activate the project it will automatically activate a syncProject () operation, which loads media files etc in the background. so your callback will be called whenever new files have arrived.
|
pure virtual |
the reference parameter passed to setCallback is passed to the callback for your own use, Moo does not touch this.
callback will be invoked if the list of projects, or a single project have changed. only one call will be executed in either case.
|
pure virtual |
sync with cloud
this is an asynchronous process. Your callback will be invoked with kProjectSynced when all media files are up- and downloaded and the project is entirely synchronised. sync will upload the Moo user's folder to the server. The server will fetch the current project from its owner, remove your folder and replace it with the uploaded one. Then Moo will download the merged project and start to upload your media files and download new files from other members if any. When all is done, your callback will get notified. If no project is currently open, nothing will happen. you may implement an auto-sync feature by calling this periodically, but it is ignored while sync is still in progress.