2008-11-29 17:13:58 +01:00
|
|
|
/*
|
2010-12-24 02:21:31 +01:00
|
|
|
clip.hpp - Definition of the Clip class
|
2010-12-17 23:28:49 +01:00
|
|
|
|
2008-11-29 17:13:58 +01:00
|
|
|
Copyright (C) Lumiera.org
|
|
|
|
|
2008, Joel Holdsworth <joel@airwebreathe.org.uk>
|
2010-12-17 23:28:49 +01:00
|
|
|
|
2008-11-29 17:13:58 +01:00
|
|
|
This program is free software; you can redistribute it and/or
|
|
|
|
|
modify it under the terms of the GNU General Public License as
|
2010-12-17 23:28:49 +01:00
|
|
|
published by the Free Software Foundation; either version 2 of
|
|
|
|
|
the License, or (at your option) any later version.
|
|
|
|
|
|
2008-11-29 17:13:58 +01:00
|
|
|
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.
|
2010-12-17 23:28:49 +01:00
|
|
|
|
2008-11-29 17:13:58 +01:00
|
|
|
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.
|
2010-12-17 23:28:49 +01:00
|
|
|
|
2008-11-29 17:13:58 +01:00
|
|
|
*/
|
2010-12-24 02:21:31 +01:00
|
|
|
/** @file model/clip.hpp
|
|
|
|
|
** This file contains the definition of the Clip object
|
2008-11-29 17:13:58 +01:00
|
|
|
*/
|
|
|
|
|
|
2010-12-27 10:35:57 +01:00
|
|
|
#include <string>
|
|
|
|
|
#include "gui/gtk-lumiera.hpp"
|
|
|
|
|
|
2011-05-15 22:51:02 +02:00
|
|
|
//#include "lib/lumitime.hpp"//////////////////////////////TODO
|
2011-01-02 16:57:14 +01:00
|
|
|
|
2010-12-27 10:35:57 +01:00
|
|
|
// TODO: Remove once we get real measure of duration.
|
|
|
|
|
// This is here *only* for purposes of testing the GUI.
|
2011-05-15 22:51:02 +02:00
|
|
|
//extern "C" {
|
|
|
|
|
//#include <stdint.h>
|
|
|
|
|
//#include <gavl/gavltime.h>
|
|
|
|
|
//}
|
2010-12-27 10:35:57 +01:00
|
|
|
|
|
|
|
|
using Cairo::Pattern;
|
|
|
|
|
|
2008-11-29 17:13:58 +01:00
|
|
|
#ifndef CLIP_HPP
|
|
|
|
|
#define CLIP_HPP
|
|
|
|
|
|
|
|
|
|
namespace gui {
|
|
|
|
|
namespace model {
|
|
|
|
|
|
2010-12-27 10:35:57 +01:00
|
|
|
class Clip
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
/**
|
|
|
|
|
* Constructor
|
2011-01-03 10:30:45 +01:00
|
|
|
*/
|
2010-12-27 10:35:57 +01:00
|
|
|
Clip();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Gets the begin time of this clip.
|
2011-01-03 10:30:45 +01:00
|
|
|
*/
|
2010-12-27 10:35:57 +01:00
|
|
|
gavl_time_t
|
|
|
|
|
getBegin() const;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Gets the end time of this clip.
|
2011-01-03 10:30:45 +01:00
|
|
|
*/
|
2010-12-27 10:35:57 +01:00
|
|
|
gavl_time_t
|
|
|
|
|
getEnd() const;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Gets the name of this clip.
|
2011-01-03 10:30:45 +01:00
|
|
|
*/
|
2010-12-27 10:35:57 +01:00
|
|
|
const std::string
|
|
|
|
|
getName() const;
|
|
|
|
|
|
2011-01-02 16:57:14 +01:00
|
|
|
/**
|
|
|
|
|
* Check whether or not the clip will be playing during the given time.
|
2011-01-03 10:30:45 +01:00
|
|
|
*/
|
2011-01-02 16:57:14 +01:00
|
|
|
bool
|
|
|
|
|
isPlayingAt(lumiera::Time position) const;
|
|
|
|
|
|
2010-12-27 10:35:57 +01:00
|
|
|
/**
|
|
|
|
|
* Sets the begin time of this clip.
|
|
|
|
|
* @param[in] begin The new begin time to set this clip to.
|
2011-01-03 10:30:45 +01:00
|
|
|
*/
|
2010-12-27 10:35:57 +01:00
|
|
|
void
|
|
|
|
|
setBegin(gavl_time_t begin);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Sets the end time of this clip.
|
|
|
|
|
* @param[in] end The new end time to set this clip to.
|
2011-01-03 10:30:45 +01:00
|
|
|
*/
|
2010-12-27 10:35:57 +01:00
|
|
|
void
|
|
|
|
|
setEnd(gavl_time_t end);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Sets the name of this clip.
|
|
|
|
|
* @param[in] name The new name to set this clip to.
|
2011-01-03 10:30:45 +01:00
|
|
|
*/
|
2010-12-27 10:35:57 +01:00
|
|
|
void
|
|
|
|
|
setName(const std::string &name);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* A signal which fires when the name changes.
|
|
|
|
|
* @return Returns the signal. The signal sends the new name for the clip.
|
2011-01-03 10:30:45 +01:00
|
|
|
*/
|
2010-12-27 10:35:57 +01:00
|
|
|
sigc::signal<void, std::string>
|
|
|
|
|
signalNameChanged() const;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The name of this clip.
|
2011-01-03 10:30:45 +01:00
|
|
|
*/
|
2010-12-27 10:35:57 +01:00
|
|
|
std::string name;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* A signal which fires when the name changes.
|
2011-01-03 10:30:45 +01:00
|
|
|
*/
|
2010-12-27 10:35:57 +01:00
|
|
|
sigc::signal<void, std::string> nameChangedSignal;
|
2008-11-29 17:13:58 +01:00
|
|
|
|
2010-12-27 10:35:57 +01:00
|
|
|
// TODO: Use a good measure of duration, probably TimeSpan.
|
|
|
|
|
// These are here *only* for purposes of testing the GUI.
|
|
|
|
|
gavl_time_t begin;
|
|
|
|
|
gavl_time_t end;
|
|
|
|
|
};
|
2008-11-29 17:13:58 +01:00
|
|
|
|
|
|
|
|
} // namespace model
|
|
|
|
|
} // namespace gui
|
|
|
|
|
|
|
|
|
|
#endif // CLIP_HPP
|