LUMIERA.clone/src/gui/model/clip.hpp

128 lines
2.9 KiB
C++
Raw Normal View History

2008-11-29 17:13:58 +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
*/
/** @file model/clip.hpp
** This file contains the definition of the Clip object
2008-11-29 17:13:58 +01:00
*/
#include <string>
#include "gui/gtk-lumiera.hpp"
2011-01-02 16:57:14 +01:00
#include "lib/lumitime.hpp"
// TODO: Remove once we get real measure of duration.
// This is here *only* for purposes of testing the GUI.
extern "C" {
#include <stdint.h>
#include <gavl/gavltime.h>
}
using Cairo::Pattern;
2008-11-29 17:13:58 +01:00
#ifndef CLIP_HPP
#define CLIP_HPP
namespace gui {
namespace model {
class Clip
{
public:
/**
* Constructor
*/
Clip();
/**
* Gets the begin time of this clip.
*/
gavl_time_t
getBegin() const;
/**
* Gets the end time of this clip.
*/
gavl_time_t
getEnd() const;
/**
* Gets the name of this clip.
*/
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-02 16:57:14 +01:00
bool
isPlayingAt(lumiera::Time position) const;
/**
* Sets the begin time of this clip.
* @param[in] begin The new begin time to set this clip to.
*/
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.
*/
void
setEnd(gavl_time_t end);
/**
* Sets the name of this clip.
* @param[in] name The new name to set this clip to.
*/
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.
*/
sigc::signal<void, std::string>
signalNameChanged() const;
private:
/**
* The name of this clip.
*/
std::string name;
/**
* A signal which fires when the name changes.
*/
sigc::signal<void, std::string> nameChangedSignal;
2008-11-29 17:13:58 +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