2011-05-24 03:46:32 +02:00
|
|
|
/*
|
|
|
|
|
PLAYER-FACADE.h - access point to the Lumiera player subsystem
|
|
|
|
|
|
|
|
|
|
Copyright (C) Lumiera.org
|
|
|
|
|
2011, Hermann Vosseler <Ichthyostega@web.de>
|
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
2016-11-03 18:26:43 +01:00
|
|
|
/** @file play-facade.h
|
|
|
|
|
** TODO play-facade.h
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
2011-05-24 03:46:32 +02:00
|
|
|
#ifndef PROC_INTERFACE_PLAY_H
|
|
|
|
|
#define PROC_INTERFACE_PLAY_H
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus /* ============== C++ Interface ================= */
|
|
|
|
|
|
|
|
|
|
//#include "include/interfaceproxy.hpp"
|
|
|
|
|
#include "lib/handle.hpp"
|
|
|
|
|
#include "lib/iter-source.hpp"
|
2011-05-28 01:46:06 +02:00
|
|
|
#include "lib/time/control.hpp"
|
2011-05-24 03:46:32 +02:00
|
|
|
#include "lib/time/timevalue.hpp"
|
2011-05-28 01:46:06 +02:00
|
|
|
#include "include/interfaceproxy.hpp"
|
2011-05-24 03:46:32 +02:00
|
|
|
#include "proc/mobject/model-port.hpp"
|
|
|
|
|
#include "proc/mobject/output-designation.hpp"
|
|
|
|
|
#include "proc/mobject/session/clip.hpp"
|
2015-05-30 22:09:26 +02:00
|
|
|
#include "proc/mobject/session/fork.hpp"
|
2011-05-24 03:46:32 +02:00
|
|
|
#include "proc/play/output-manager.hpp"
|
2011-05-28 01:46:06 +02:00
|
|
|
#include "proc/asset/timeline.hpp"
|
|
|
|
|
#include "proc/asset/viewer.hpp"
|
2011-05-24 03:46:32 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-06-04 16:33:35 +02:00
|
|
|
namespace proc {
|
|
|
|
|
namespace play {
|
|
|
|
|
|
|
|
|
|
class PlayProcess;
|
|
|
|
|
}}
|
2011-05-24 03:46:32 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace lumiera {
|
2011-05-28 01:46:06 +02:00
|
|
|
|
|
|
|
|
namespace time = lib::time;
|
2011-06-25 17:44:28 +02:00
|
|
|
|
2014-04-03 22:42:48 +02:00
|
|
|
using std::weak_ptr;
|
2011-05-24 03:46:32 +02:00
|
|
|
|
|
|
|
|
|
2013-10-24 23:06:36 +02:00
|
|
|
/**************************************************************//**
|
2011-12-17 02:20:48 +01:00
|
|
|
* Interface to the Player subsystem of Lumiera (Proc-Layer).
|
2011-05-24 03:46:32 +02:00
|
|
|
* Global access point for starting playback and render processes,
|
|
|
|
|
* calculating media data by running the render engine.
|
|
|
|
|
*
|
2013-10-25 06:34:38 +02:00
|
|
|
* @ingroup player
|
2011-05-24 03:46:32 +02:00
|
|
|
* @todo WIP-WIP-WIP 6/2011
|
|
|
|
|
* @note Lumiera is not yet able actually to deliver rendered data.
|
|
|
|
|
* @todo there should be an accompanying CL Interface defined for
|
|
|
|
|
* the Lumiera interface system, so the player can be
|
|
|
|
|
* accessed from external clients. This was left out
|
|
|
|
|
* for now, as we don't have either plugins, nor
|
|
|
|
|
* any script running capabilities yet. (5/2011)
|
|
|
|
|
*/
|
|
|
|
|
class Play
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
/** get an implementation instance of this service */
|
2011-05-28 01:46:06 +02:00
|
|
|
static lumiera::facade::Accessor<Play> facade;
|
2011-05-24 03:46:32 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Continuous playback process, which has been hooked up
|
|
|
|
|
* and started with a fixed set of output slots. started with a specific
|
|
|
|
|
* output size, format and framerate. It is a handle to a calculation process,
|
|
|
|
|
* which is about to produce a stream of frames and push them to the outputs.
|
|
|
|
|
*
|
|
|
|
|
* The Lifecycle of the referred playback process is managed automatically
|
|
|
|
|
* through this handle (by ref count). Client code is supposed to use the
|
|
|
|
|
* API on this handle to navigate and control the playback mode.
|
|
|
|
|
*
|
2013-10-25 06:34:38 +02:00
|
|
|
* @ingroup player
|
2011-05-24 03:46:32 +02:00
|
|
|
* @see handle.hpp
|
|
|
|
|
* @see player-service.cpp implementation
|
|
|
|
|
*/
|
|
|
|
|
class Controller
|
|
|
|
|
: public lib::Handle<proc::play::PlayProcess>
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
void play(bool); ///< play/pause toggle
|
2011-05-25 02:41:04 +02:00
|
|
|
void scrub(bool); ///< scrubbing playback
|
2011-05-24 03:46:32 +02:00
|
|
|
void adjustSpeed(double); ///< playback speed control
|
2011-12-17 02:20:48 +01:00
|
|
|
void go(time::Time); ///< skip to the given point in time
|
2011-05-25 02:41:04 +02:00
|
|
|
|
2011-05-28 01:46:06 +02:00
|
|
|
void controlPlayhead (time::Control<time::Time> & ctrl);
|
|
|
|
|
void controlDuration (time::Control<time::Duration> & ctrl);
|
|
|
|
|
void controlLooping (time::Control<time::TimeSpan> & ctrl);
|
2011-05-25 02:41:04 +02:00
|
|
|
|
|
|
|
|
void useProxyMedia (bool);
|
|
|
|
|
void setQuality (uint);
|
|
|
|
|
|
|
|
|
|
bool is_playing() const;
|
|
|
|
|
bool is_scrubbing() const;
|
|
|
|
|
double getSpeed() const;
|
|
|
|
|
uint getQuality() const;
|
|
|
|
|
bool usesProxy() const;
|
2011-06-24 18:40:19 +02:00
|
|
|
|
2011-06-25 17:44:28 +02:00
|
|
|
operator weak_ptr<proc::play::PlayProcess>() const;
|
2011-05-24 03:46:32 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
2015-07-02 19:16:46 +02:00
|
|
|
using ModelPorts = lib::IterSource<proc::mobject::ModelPort>::iterator;
|
|
|
|
|
using Pipes = lib::IterSource<proc::mobject::OutputDesignation>::iterator;
|
|
|
|
|
using Output = proc::play::POutputManager;
|
|
|
|
|
using Clip = proc::mobject::session::PClip;
|
|
|
|
|
using Fork = proc::mobject::PFork;
|
|
|
|
|
using Timeline = proc::asset::PTimeline;
|
|
|
|
|
using Viewer = proc::asset::PViewer;
|
2011-06-13 20:07:30 +02:00
|
|
|
|
2011-05-24 03:46:32 +02:00
|
|
|
|
|
|
|
|
/* ==== convenience shortcuts for common use cases ==== */
|
2013-06-03 05:25:13 +02:00
|
|
|
Controller perform(ModelPorts, Output);
|
2011-05-24 03:46:32 +02:00
|
|
|
Controller perform(Pipes, Output);
|
|
|
|
|
Controller perform(Timeline);
|
|
|
|
|
Controller perform(Viewer);
|
2015-05-31 02:03:24 +02:00
|
|
|
Controller perform(Fork);
|
2011-05-24 03:46:32 +02:00
|
|
|
Controller perform(Clip);
|
|
|
|
|
|
|
|
|
|
protected:
|
2011-05-28 01:46:06 +02:00
|
|
|
virtual ~Play();
|
2013-06-03 05:25:13 +02:00
|
|
|
|
|
|
|
|
/** core operation: create a new playback process
|
|
|
|
|
* outputting to the given viewer/display */
|
|
|
|
|
virtual Controller connect(ModelPorts, Output) =0;
|
2011-05-24 03:46:32 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace lumiera
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif /* =========================== CL Interface ===================== */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// #include "common/interface.h"
|
|
|
|
|
////////////////////////////////////TODO define a C binding for the Interface system here
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|