sync with Lumiera master

This commit is contained in:
Fischlurch 2010-12-26 23:33:57 +01:00
commit 58e98ab01c
66 changed files with 3407 additions and 199 deletions

View file

@ -27,6 +27,10 @@ For Ubuntu Hardy also:
* libgtkmm-2.4-dev
* libxv-dev
Optionally, you may also want to install:
* gtk2-engines
also check http://gnuradio.org/trac/wiki/UbuntuInstall#InstallationOptions to
see that all your installations options are met.
@ -67,11 +71,11 @@ make check
This will take some time. After it has finished:
./lumigui
./lumiera
[NewbiesTut]
Contibuting
Contributing
Nothing is easier, follow the basic instructions at http://www.kernel.org/pub/
software/scm/git/docs/gittutorial.html, notably the

BIN
doc/devel/uml/fig142725.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View file

@ -3,7 +3,7 @@
[icon="warning.png"]
WARNING: Website under construction
This documentation section contains documentation for both users and developpers.
This documentation section contains documentation for both users and developers.
=== User
@ -11,7 +11,7 @@ The user manual containing the full reference for using Lumiera :
* link:manual.html[User Manual] _(planned)_
=== Developper
=== Developer
Informations about the structure of Lumiera, they give an overview on the main components of the application :
* link:design/index.html[Design Documents]

View file

@ -248,8 +248,6 @@ Timeline View
Asset View
~~~~~~~~~~
// currently named 'resources' should be renamed to 'assets'
// Manages all assets available in one project.
// * source media/footage/soundfiles
// * prepared clips, known subprojects

View file

@ -40,7 +40,7 @@ icons = \
$(16x16)/track-enabled.png \
$(16x16)/track-locked.png \
$(16x16)/track-unlocked.png \
$(16x16)/panel-resources.png $(22x22)/panel-resources.png $(32x32)/panel-resources.png \
$(16x16)/panel-assets.png $(22x22)/panel-assets.png $(32x32)/panel-assets.png \
$(16x16)/panel-timeline.png \
$(16x16)/panel-viewer.png $(22x22)/panel-viewer.png $(32x32)/panel-viewer.png
@ -79,12 +79,12 @@ $(16x16)/track-unlocked.png : $(svgdir)/track-unlocked.svg $(top_builddir)/rsvg-
# Panels
$(16x16)/panel-resources.png: $(16x16pre)/panel-resources.png
cp $(16x16pre)/panel-resources.png $(16x16)
$(22x22)/panel-resources.png: $(22x22pre)/panel-resources.png
cp $(22x22pre)/panel-resources.png $(22x22)
$(32x32)/panel-resources.png: $(32x32pre)/panel-resources.png
cp $(32x32pre)/panel-resources.png $(32x32)
$(16x16)/panel-assets.png: $(16x16pre)/panel-assets.png
cp $(16x16pre)/panel-assets.png $(16x16)
$(22x22)/panel-assets.png: $(22x22pre)/panel-assets.png
cp $(22x22pre)/panel-assets.png $(22x22)
$(32x32)/panel-assets.png: $(32x32pre)/panel-assets.png
cp $(32x32pre)/panel-assets.png $(32x32)
$(16x16)/panel-timeline.png: $(16x16pre)/panel-timeline.png
cp $(16x16pre)/panel-timeline.png $(16x16)

View file

Before

Width:  |  Height:  |  Size: 540 B

After

Width:  |  Height:  |  Size: 540 B

View file

Before

Width:  |  Height:  |  Size: 695 B

After

Width:  |  Height:  |  Size: 695 B

View file

Before

Width:  |  Height:  |  Size: 1 KiB

After

Width:  |  Height:  |  Size: 1 KiB

View file

@ -89,12 +89,16 @@ gtk_gui_la_SOURCES = \
$(lumigui_srcdir)/output/xvdisplayer.hpp \
$(lumigui_srcdir)/panels/panel.cpp \
$(lumigui_srcdir)/panels/panel.hpp \
$(lumigui_srcdir)/panels/resources-panel.cpp \
$(lumigui_srcdir)/panels/resources-panel.hpp \
$(lumigui_srcdir)/panels/assets-panel.cpp \
$(lumigui_srcdir)/panels/assets-panel.hpp \
$(lumigui_srcdir)/panels/timeline-panel.cpp \
$(lumigui_srcdir)/panels/timeline-panel.hpp \
$(lumigui_srcdir)/panels/viewer-panel.cpp \
$(lumigui_srcdir)/panels/viewer-panel.hpp \
$(lumigui_srcdir)/util/cairo-util.cpp \
$(lumigui_srcdir)/util/cairo-util.hpp \
$(lumigui_srcdir)/util/convert.cpp \
$(lumigui_srcdir)/util/convert.hpp \
$(lumigui_srcdir)/util/rectangle.cpp \
$(lumigui_srcdir)/util/rectangle.hpp \
$(lumigui_srcdir)/widgets/button-bar.cpp \
@ -104,6 +108,8 @@ gtk_gui_la_SOURCES = \
$(lumigui_srcdir)/widgets/mini-button.hpp \
$(lumigui_srcdir)/widgets/panel-bar.cpp \
$(lumigui_srcdir)/widgets/panel-bar.hpp \
$(lumigui_srcdir)/widgets/timecode-widget.cpp \
$(lumigui_srcdir)/widgets/timecode-widget.hpp \
$(lumigui_srcdir)/widgets/timeline-widget.cpp \
$(lumigui_srcdir)/widgets/timeline-widget.hpp \
$(lumigui_srcdir)/widgets/timeline/timeline-arrow-tool.cpp \

View file

@ -116,7 +116,7 @@ GtkLumiera::get_app_authors()
"Joel Holdsworth",
"Christian Thaeter",
"Hermann Vosseler",
"<Other Authors Here>"};
"[Other Authors Here]"};
const int count = sizeof(app_authors) / sizeof(gchar*);
std::vector<Glib::ustring> list(count);

View file

@ -20,7 +20,7 @@
*/
/**
* @file widgets/timeline/clip-track.hpp
* @file model/clip-track.hpp
* This file contains the definition of timeline track objects which
* contain clips.
*/

View file

@ -1,6 +1,6 @@
/*
timeline-track.cpp - Implementation of the timeline clip object
clip.cpp - Implementation of the Clip object
Copyright (C) Lumiera.org
2008, Joel Holdsworth <joel@airwebreathe.org.uk>

View file

@ -1,5 +1,5 @@
/*
timeline-clip.hpp - Declaration of the timeline clip object
clip.hpp - Definition of the Clip class
Copyright (C) Lumiera.org
2008, Joel Holdsworth <joel@airwebreathe.org.uk>
@ -19,8 +19,8 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/** @file widgets/timeline/timeline-clip.hpp
** This file contains the definition of timeline clip object
/** @file model/clip.hpp
** This file contains the definition of the Clip object
*/
#ifndef CLIP_HPP
@ -32,6 +32,9 @@ namespace model {
class Clip
{
public:
/**
* Constructor
**/
Clip();
};

View file

@ -89,7 +89,7 @@ public:
protected:
/**
* The internal list of child tracks of this paremt.
* The internal list of child tracks of this parent.
**/
lumiera::observable_list< boost::shared_ptr<Track> > tracks;
};

View file

@ -46,17 +46,21 @@ Sequence::Sequence()
{
group_track->get_child_track_list().push_back(
clip_track = shared_ptr<ClipTrack>(new ClipTrack()));
clip_track->set_name("Clip Track 1");
group_track->get_child_track_list().push_back(
group_track2 = shared_ptr<GroupTrack>(new GroupTrack()));
group_track2->set_name("Group Track 2");
group_track2->get_child_track_list().push_back(
shared_ptr<ClipTrack>(new ClipTrack()));
clip_track = shared_ptr<ClipTrack>(new ClipTrack()));
clip_track->set_name("Clip Track 2");
first = false;
}
tracks.push_back(shared_ptr<GroupTrack>(new GroupTrack()));
tracks.push_back(group_track = shared_ptr<GroupTrack>(new GroupTrack()));
group_track->set_name("Group Track 3");
tracks.push_back(shared_ptr<Track>(new ClipTrack()));
tracks.push_back(clip_track = shared_ptr<ClipTrack>(new ClipTrack()));
clip_track->set_name("Clip Track 3");
// END TEST CODE

View file

@ -21,12 +21,12 @@
* *****************************************************/
#include "../gtk-lumiera.hpp"
#include "resources-panel.hpp"
#include "assets-panel.hpp"
namespace gui {
namespace panels {
ResourcesPanel::ResourcesPanel(workspace::PanelManager &panel_manager,
AssetsPanel::AssetsPanel(workspace::PanelManager &panel_manager,
GdlDockItem *dock_item) :
Panel(panel_manager, dock_item, get_title(), get_stock_id())
{
@ -39,15 +39,15 @@ ResourcesPanel::ResourcesPanel(workspace::PanelManager &panel_manager,
}
const char*
ResourcesPanel::get_title()
AssetsPanel::get_title()
{
return _("Resources");
return _("Assets");
}
const gchar*
ResourcesPanel::get_stock_id()
AssetsPanel::get_stock_id()
{
return "panel_resources";
return "panel_assets";
}
} // namespace panels

View file

@ -31,7 +31,7 @@
namespace gui {
namespace panels {
class ResourcesPanel : public Panel
class AssetsPanel : public Panel
{
public:
/**
@ -39,7 +39,7 @@ public:
* @param panel_manager The owner panel manager widget.
* @param dock_item The GdlDockItem that will host this panel.
**/
ResourcesPanel(workspace::PanelManager &panel_manager,
AssetsPanel(workspace::PanelManager &panel_manager,
GdlDockItem *dock_item);
/**

View file

@ -49,8 +49,7 @@ const int TimelinePanel::ZoomToolSteps = 2; // 2 seems comfortable
TimelinePanel::TimelinePanel(workspace::PanelManager &panel_manager,
GdlDockItem *dock_item) :
Panel(panel_manager, dock_item, get_title(), get_stock_id()),
timeIndicator(),
timeIndicatorButton(),
timeCode("sequence_clock", "timecode_widget", true),
previousButton(Stock::MEDIA_PREVIOUS),
rewindButton(Stock::MEDIA_REWIND),
playPauseButton(Stock::MEDIA_PLAY),
@ -62,7 +61,7 @@ TimelinePanel::TimelinePanel(workspace::PanelManager &panel_manager,
zoomIn(Stock::ZOOM_IN),
zoomOut(Stock::ZOOM_OUT),
updatingToolbar(false),
currentTool(timeline::IBeam)
currentTool(timeline::Arrow)
{
// Hook up notifications
get_project().get_sequences().signal_changed().connect(mem_fun(this,
@ -82,11 +81,7 @@ TimelinePanel::TimelinePanel(workspace::PanelManager &panel_manager,
panelBar.pack_start(sequenceChooser, PACK_SHRINK);
// Setup the toolbar
timeIndicatorButton.add(timeIndicator);
timeIndicatorButton.set_relief(Gtk::RELIEF_NONE);
timeIndicatorButton.set_focus_on_click(false);
toolbar.append(timeIndicatorButton);
toolbar.append(timeCode);
toolbar.append(previousButton);
toolbar.append(rewindButton);
@ -97,14 +92,14 @@ TimelinePanel::TimelinePanel(workspace::PanelManager &panel_manager,
toolbar.append(forwardButton);
toolbar.append(nextButton);
toolbar.append(seperator1);
toolbar.append(separator1);
toolbar.append(arrowTool,
mem_fun(this, &TimelinePanel::on_arrow_tool));
toolbar.append(iBeamTool,
mem_fun(this, &TimelinePanel::on_ibeam_tool));
toolbar.append(seperator2);
toolbar.append(separator2);
toolbar.append(zoomIn, mem_fun(this, &TimelinePanel::on_zoom_in));
toolbar.append(zoomOut, mem_fun(this, &TimelinePanel::on_zoom_out));
@ -114,7 +109,6 @@ TimelinePanel::TimelinePanel(workspace::PanelManager &panel_manager,
// Setup tooltips
sequenceChooser .set_tooltip_text(_("Change sequence"));
timeIndicatorButton .set_tooltip_text(_("Go to time code"));
previousButton .set_tooltip_text(_("To beginning"));
rewindButton .set_tooltip_text(_("Rewind"));
@ -374,7 +368,7 @@ TimelinePanel::set_tool(timeline::ToolType tool)
void
TimelinePanel::show_time(gavl_time_t time)
{
timeIndicator.set_text(lumiera_tmpbuf_print_time(time));
// timeIndicator.set_text(lumiera_tmpbuf_print_time(time));
}
bool

View file

@ -27,6 +27,7 @@
#define TIMELINE_PANEL_HPP
#include "panel.hpp"
#include "../widgets/timecode-widget.hpp"
#include "../widgets/timeline-widget.hpp"
using namespace gui::widgets;
@ -168,8 +169,7 @@ private:
timelineStates;
// Toolbar Widgets
Gtk::Label timeIndicator;
Gtk::Button timeIndicatorButton;
TimeCode timeCode;
MiniButton previousButton;
MiniButton rewindButton;
@ -181,12 +181,12 @@ private:
MiniToggleButton arrowTool;
MiniToggleButton iBeamTool;
Gtk::SeparatorToolItem seperator1;
Gtk::SeparatorToolItem separator1;
MiniButton zoomIn;
MiniButton zoomOut;
Gtk::SeparatorToolItem seperator2;
Gtk::SeparatorToolItem separator2;
// Internals
bool updatingToolbar;

View file

@ -0,0 +1,81 @@
/*
cairo-util.cpp - Defines utility functions for Cairo
Copyright (C) Lumiera.org
2010, Stefan Kangas <skangas@skangas.se>
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.
* *****************************************************/
#include "cairo-util.hpp"
namespace gui {
namespace util {
RefPtr<SolidPattern>
CairoUtil::pattern_set_red (const RefPtr<SolidPattern> color, double red)
{
double old_red;
double blue;
double green;
double alpha;
color->get_rgba (old_red, blue, green, alpha);
return Cairo::SolidPattern::create_rgba (red, blue, green, alpha);
}
RefPtr<SolidPattern>
CairoUtil::pattern_set_green (const RefPtr<SolidPattern> color, double blue)
{
double red;
double old_blue;
double green;
double alpha;
color->get_rgba (red, old_blue, green, alpha);
return Cairo::SolidPattern::create_rgba (red, blue, green, alpha);
}
RefPtr<SolidPattern>
CairoUtil::pattern_set_blue (const RefPtr<SolidPattern> color, double green)
{
double red;
double blue;
double old_green;
double alpha;
color->get_rgba (red, blue, old_green, alpha);
return Cairo::SolidPattern::create_rgba (red, blue, green, alpha);
}
RefPtr<SolidPattern>
CairoUtil::pattern_set_alpha (const RefPtr<SolidPattern> color, double alpha)
{
double red;
double blue;
double green;
double old_alpha;
color->get_rgba (red, blue, green, old_alpha);
return Cairo::SolidPattern::create_rgba (red, blue, green, alpha);
}
} // namespace util
} // namespace gui

View file

@ -0,0 +1,73 @@
/*
cairo-util.hpp - Declares utility functions for Cairo
Copyright (C) Lumiera.org
2010, Stefan Kangas <skangas@skangas.se>
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.
* *****************************************************/
#include <cairomm/cairomm.h>
#ifndef UTIL_CAIRO_HPP
#define UTIL_CAIRO_HPP
using Cairo::RefPtr;
using Cairo::SolidPattern;
namespace gui {
namespace util {
class CairoUtil
{
public:
/**
* Make a new SolidPattern from an old one, changing the red component of the color.
* @param The new value for the red component of the color.
* @return The new pattern.
*/
static RefPtr<SolidPattern>
pattern_set_red (const RefPtr<SolidPattern> color, double red);
/**
* Make a new SolidPattern from an old one, changing the green component of the color.
* @param The new value for the green component of the color.
* @return The new pattern.
*/
static RefPtr<SolidPattern>
pattern_set_green (const RefPtr<SolidPattern>, double green);
/**
* Make a new SolidPattern from an old one, changing the blue component of the color.
* @param The new value for the blue component of the color.
* @return The new pattern.
*/
static RefPtr<SolidPattern>
pattern_set_blue (const RefPtr<SolidPattern>, double blue);
/**
* Make a new SolidPattern from an old one, changing the alpha component of the color.
* @param The new value for the alpha component of the color.
* @return The new pattern.
*/
static RefPtr<SolidPattern>
pattern_set_alpha (const RefPtr<SolidPattern>, double alpha);
};
} // namespace util
} // namespace gui
#endif

44
src/gui/util/convert.cpp Normal file
View file

@ -0,0 +1,44 @@
/*
convert.cpp - Defines utility functions for conversions
Copyright (C) Lumiera.org
2006, Paul Davis
2010, Stefan Kangas <skangas@skangas.se>
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.
*/
#include <cstdlib>
#include "convert.hpp"
namespace gui {
namespace util {
double
atof (const string& s)
{
return std::atof (s.c_str());
}
int
atoi (const string& s)
{
return std::atoi (s.c_str());
}
} // namespace util
} // namespace gui

38
src/gui/util/convert.hpp Normal file
View file

@ -0,0 +1,38 @@
/*
convert.hpp - Declares utility functions for conversions
Copyright (C) Lumiera.org
2006, Paul Davis
2010, Stefan Kangas <skangas@skangas.se>
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.
*/
#include <string>
using std::string;
namespace gui {
namespace util {
double atof(const string& s);
int atoi(const string& s);
} // namespace util
} // namespace gui

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,196 @@
/*
timecode-widget.hpp - Declaration of the timecode widget
Copyright (C) 1999 Paul Davis
Copyright (C) Lumiera.org
2010, Stefan Kangas <skangas@skangas.se
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.
*/
#ifndef TIMECODE_WIDGET_HPP
#define TIMECODE_WIDGET_HPP
#include <string>
#include <gtkmm/box.h>
#include <gtkmm/menu.h>
#include <gtkmm/eventbox.h>
#include <gtkmm/label.h>
#include <gtkmm/frame.h>
#include "lib/lumitime.hpp"
using lumiera::Time;
namespace gui {
namespace widgets {
class TimeCode : public Gtk::HBox
{
public:
enum Mode {
SMPTE,
MinSec,
Frames,
Off
};
TimeCode(std::string clock_name, std::string widget_name, bool editable /*, bool is_duration = false*/);
Mode mode() const { return _mode; }
void focus();
void set(Time when, bool force = false);
void set_mode(Mode);
void set_widget_name(std::string);
std::string name() const { return _name; }
Time current_time(Time position = Time(0)) const;
Time current_duration(Time position = Time(0)) const;
sigc::signal<void> ValueChanged;
sigc::signal<void> ChangeAborted;
static sigc::signal<void> ModeChanged;
// static std::vector<TimeCode*> clocks;
static bool has_focus() { return _has_focus; }
private:
Mode _mode;
unsigned int key_entry_state;
std::string _name;
// bool is_duration;
bool editable;
Gtk::Menu *ops_menu;
Gtk::HBox smpte_packer_hbox;
Gtk::HBox smpte_packer;
Gtk::HBox minsec_packer_hbox;
Gtk::HBox minsec_packer;
Gtk::HBox frames_packer_hbox;
Gtk::HBox frames_packer;
enum Field {
SMPTE_Hours,
SMPTE_Minutes,
SMPTE_Seconds,
SMPTE_Frames,
MS_Hours,
MS_Minutes,
MS_Seconds,
VFrames
};
Gtk::EventBox audio_frames_ebox;
Gtk::Label audio_frames_label;
Gtk::HBox off_hbox;
Gtk::EventBox hours_ebox;
Gtk::EventBox minutes_ebox;
Gtk::EventBox seconds_ebox;
Gtk::EventBox frames_ebox;
Gtk::EventBox ms_hours_ebox;
Gtk::EventBox ms_minutes_ebox;
Gtk::EventBox ms_seconds_ebox;
Gtk::Label hours_label;
Gtk::Label minutes_label;
Gtk::Label seconds_label;
Gtk::Label frames_label;
Gtk::Label colon1, colon2, colon3;
Gtk::Label ms_hours_label;
Gtk::Label ms_minutes_label;
Gtk::Label ms_seconds_label;
Gtk::Label colon4, colon5;
Gtk::EventBox clock_base;
Gtk::Frame clock_frame;
Time last_when;
bool last_pdelta;
bool last_sdelta;
int last_hrs;
int last_mins;
int last_secs;
int last_frames;
bool last_negative;
int ms_last_hrs;
int ms_last_mins;
float ms_last_secs;
bool dragging;
double drag_start_y;
double drag_y;
double drag_accum;
void on_realize();
bool field_motion_notify_event(GdkEventMotion *ev, Field);
bool field_button_press_event(GdkEventButton *ev, Field);
bool field_button_release_event(GdkEventButton *ev, Field);
bool field_button_scroll_event(GdkEventScroll *ev, Field);
bool field_key_press_event(GdkEventKey *ev, Field);
bool field_key_release_event(GdkEventKey *ev, Field);
bool field_focus_in_event(GdkEventFocus *ev, Field);
bool field_focus_out_event(GdkEventFocus *ev, Field);
bool drop_focus_handler(GdkEventFocus *ev);
void set_smpte(Time, bool);
void set_minsec(Time, bool);
void set_frames(Time, bool);
int get_frames(Field, Time pos = Time(0), int dir=1);
void smpte_sanitize_display();
Time smpte_time_from_display() const;
Time minsec_time_from_display() const;
Time audio_time_from_display() const;
void build_ops_menu();
void setup_events();
void smpte_offset_changed();
void set_size_requests();
static const unsigned int field_length[(int)VFrames+1];
static bool _has_focus;
void set_size_request_to_display_given_text(Gtk::Widget &w, const gchar *text,
gint hpadding, gint vpadding);
void get_ink_pixel_size(Glib::RefPtr<Pango::Layout> layout,
int& width, int& height);
};
} // namespace widgets
} // namespace gui
#endif // TIMECODE_WIDGET_HPP

View file

@ -41,7 +41,7 @@ ArrowTool::get_type() const
Gdk::Cursor
ArrowTool::get_cursor() const
{
return Gdk::Cursor(Gdk::ARROW);
return Gdk::Cursor(Gdk::LEFT_PTR);
}
void

View file

@ -1,6 +1,6 @@
/*
timeline.cpp - Implementation of the timeline widget
timeline-body.cpp - Implementation of the timeline body widget
Copyright (C) Lumiera.org
2008, Joel Holdsworth <joel@airwebreathe.org.uk>
@ -26,6 +26,7 @@
#include "timeline-body.hpp"
#include "../timeline-widget.hpp"
#include "../../window-manager.hpp"
#include "../../util/cairo-util.hpp"
#include "timeline-arrow-tool.hpp"
#include "timeline-ibeam-tool.hpp"
@ -36,6 +37,8 @@ using namespace std;
using namespace boost;
using namespace lumiera;
using gui::util::CairoUtil;
namespace gui {
namespace widgets {
namespace timeline {
@ -357,8 +360,8 @@ TimelineBody::draw_track(Cairo::RefPtr<Cairo::Context> cr,
// Draw the track background
cr->rectangle(0, 0, view_width, height);
GdkColor colour = backgroundColour; // Needed to preserve const qualifier
gdk_cairo_set_source_color(cr->cobj(), &colour);
Cairo::RefPtr<Cairo::SolidPattern> bg_col = backgroundColour; // Needed to preserve const qualifier
cr->set_source(bg_col);
cr->fill();
// Render the track
@ -386,17 +389,13 @@ TimelineBody::draw_selection(Cairo::RefPtr<Cairo::Context> cr)
// Draw the cover
if(end_x > 0 && start_x < allocation.get_width())
{
cr->set_source_rgba(
(float)selectionColour.red / 0xFFFF,
(float)selectionColour.green / 0xFFFF,
(float)selectionColour.blue / 0xFFFF,
selectionAlpha);
cr->set_source (CairoUtil::pattern_set_alpha (selectionColour, selectionAlpha));
cr->rectangle(start_x + 0.5, 0,
end_x - start_x, allocation.get_height());
cr->fill();
}
gdk_cairo_set_source_color(cr->cobj(), &selectionColour);
cr->set_source(selectionColour);
cr->set_line_width(1);
// Draw the start
@ -435,7 +434,7 @@ TimelineBody::draw_playback_point(Cairo::RefPtr<Cairo::Context> cr)
const int x = view_window().time_to_x(point);
// Set source
gdk_cairo_set_source_color(cr->cobj(), &playbackPointColour);
cr->set_source(playbackPointColour);
cr->set_line_width(1);
// Draw

View file

@ -183,10 +183,10 @@ private:
int beginShiftVerticalOffset;
// Style properties
GdkColor backgroundColour;
GdkColor selectionColour;
Cairo::RefPtr<Cairo::SolidPattern> backgroundColour;
Cairo::RefPtr<Cairo::SolidPattern> selectionColour;
float selectionAlpha;
GdkColor playbackPointColour;
Cairo::RefPtr<Cairo::SolidPattern> playbackPointColour;
gui::widgets::TimelineWidget &timelineWidget;

View file

@ -20,6 +20,9 @@
* *****************************************************/
#include <boost/foreach.hpp>
#include "timeline-clip.hpp"
#include "timeline-clip-track.hpp"
#include "timeline-view-window.hpp"
@ -28,19 +31,26 @@ using namespace Gtk;
namespace gui {
namespace widgets {
namespace timeline {
ClipTrack::ClipTrack(TimelineWidget &timeline_widget,
boost::shared_ptr<model::Track> track) :
Track(timeline_widget, track)
{
// TEST CODE: add a clip to the track
boost::shared_ptr<model::Clip> model_clip(new model::Clip());
boost::shared_ptr<timeline::Clip> timeline_clip(new timeline::Clip(model_clip));
clips.push_back(timeline_clip);
// END TEST CODE
}
void
ClipTrack::draw_track(Cairo::RefPtr<Cairo::Context> cairo,
TimelineViewWindow* const window) const
{
REQUIRE(cairo);
REQUIRE(window);
// Draw a rectangle to let us know it works? :-)
cairo->rectangle(window->time_to_x(0), 1,
window->time_to_x(500000) - window->time_to_x(0),
get_height() - 2);
@ -50,6 +60,12 @@ ClipTrack::draw_track(Cairo::RefPtr<Cairo::Context> cairo,
cairo->set_source_rgb(0.25, 0.25, 0.25);
cairo->stroke();
// Draw all clips
BOOST_FOREACH(boost::shared_ptr<timeline::Clip> c, clips)
{
c->draw_clip(cairo, window);
}
}
} // namespace timeline

View file

@ -28,6 +28,8 @@
#ifndef TIMELINE_CLIP_TRACK_HPP
#define TIMELINE_CLIP_TRACK_HPP
#include <vector>
#include "timeline-track.hpp"
#include "../../model/clip-track.hpp"
@ -46,7 +48,9 @@ public:
void draw_track(Cairo::RefPtr<Cairo::Context> cairo,
TimelineViewWindow* const window) const;
private:
std::vector<boost::shared_ptr<timeline::Clip> > clips;
};
} // namespace timeline

View file

@ -1,6 +1,6 @@
/*
timeline-track.cpp - Implementation of the timeline clip object
timeline-clip.cpp - Implementation of the timeline clip object
Copyright (C) Lumiera.org
2008, Joel Holdsworth <joel@airwebreathe.org.uk>
@ -26,11 +26,48 @@ namespace gui {
namespace widgets {
namespace timeline {
Clip::Clip()
Clip::Clip(boost::shared_ptr<model::Clip> clip)
: model_clip(clip)
{
REQUIRE(model_clip);
}
void
Clip::draw_clip(Cairo::RefPtr<Cairo::Context> cr,
TimelineViewWindow* const window) const
{
REQUIRE(cr);
REQUIRE(window);
int x = window->time_to_x(1000000);
int width = window->time_to_x(2000000) - window->time_to_x(1000000);
// Draw a rectangle for the clip
cr->rectangle(x, 1, width, 100-2);
// TODO: get duration from the model::Clip
// TODO: get height from the Timeline::Track
cr->set_source_rgb(0.4, 0.4, 0.4);
cr->fill_preserve();
cr->set_source_rgb(0.25, 0.25, 0.25);
cr->stroke();
// Show the clip name
cr->rectangle(x, 1, width, 100-2);
cr->clip();
cr->move_to (x + 3, 12);
cr->set_source_rgb (1.0, 1.0, 1.0);
cr->set_font_size (9);
cr->show_text ("Clip Name"); // TODO: get clip name from model
// TODO: Show thumbnails for clip
}
} // namespace timeline
} // namespace widgets
} // namespace gui

View file

@ -23,7 +23,11 @@
** This file contains the definition of timeline clip object
*/
#include "../../gtk-lumiera.hpp"
#include "../../model/clip.hpp"
#include "timeline-view-window.hpp"
#include "include/logging.h"
#ifndef TIMELINE_CLIP_HPP
#define TIMELINE_CLIP_HPP
@ -35,11 +39,16 @@ namespace timeline {
class Clip : public model::Clip
{
public:
Clip();
Clip(boost::shared_ptr<model::Clip> clip);
void draw_clip(Cairo::RefPtr<Cairo::Context> cairo,
TimelineViewWindow* const window) const;
private:
boost::shared_ptr<model::Clip> model_clip;
};
} // namespace timeline
} // namespace widgets
} // namespace gui

View file

@ -25,6 +25,7 @@
#include "timeline-ruler.hpp"
#include "../timeline-widget.hpp"
#include "../../window-manager.hpp"
#include "../../util/cairo-util.hpp"
extern "C" {
#include "../../../lib/time.h"
@ -39,6 +40,8 @@ using namespace gui::widgets;
using namespace gui::widgets::timeline;
using namespace lumiera;
using gui::util::CairoUtil;
namespace gui {
namespace widgets {
namespace timeline {
@ -445,15 +448,11 @@ TimelineRuler::draw_playback_period(Cairo::RefPtr<Cairo::Context> cr,
}
// Fill
cr->set_source_rgba(
(float)playbackPeriodArrowColour.red / 0xFFFF,
(float)playbackPeriodArrowColour.green / 0xFFFF,
(float)playbackPeriodArrowColour.blue / 0xFFFF,
playbackPeriodArrowAlpha);
cr->set_source (CairoUtil::pattern_set_alpha (playbackPeriodArrowColour, playbackPeriodArrowAlpha));
cr->fill_preserve();
// Stroke
gdk_cairo_set_source_color(cr->cobj(), &playbackPeriodArrowColour);
cr->set_source(playbackPeriodArrowColour);
cr->set_line_width(1);
cr->stroke();
}
@ -481,15 +480,11 @@ TimelineRuler::draw_playback_point(Cairo::RefPtr<Cairo::Context> cr,
cr->close_path();
// Fill
cr->set_source_rgba(
(float)playbackPointColour.red / 0xFFFF,
(float)playbackPointColour.green / 0xFFFF,
(float)playbackPointColour.blue / 0xFFFF,
playbackPointAlpha);
cr->set_source (CairoUtil::pattern_set_alpha (playbackPeriodArrowColour, playbackPeriodArrowAlpha));
cr->fill_preserve();
// Stroke
gdk_cairo_set_source_color(cr->cobj(), &playbackPointColour);
cr->set_source(playbackPointColour);
cr->set_line_width(1);
cr->stroke();
}

View file

@ -218,11 +218,11 @@ private:
int mouseChevronSize;
int selectionChevronSize;
GdkColor playbackPointColour;
Cairo::RefPtr<Cairo::SolidPattern> playbackPointColour;
float playbackPointAlpha;
int playbackPointSize;
GdkColor playbackPeriodArrowColour;
Cairo::RefPtr<Cairo::SolidPattern> playbackPeriodArrowColour;
float playbackPeriodArrowAlpha;
int playbackPeriodArrowSize;
int playbackPeriodArrowStemSize;

View file

@ -40,8 +40,10 @@ Track::Track(TimelineWidget &timeline_widget,
shared_ptr<model::Track> track) :
timelineWidget(timeline_widget),
model_track(track),
enabled(true),
expanded(true),
expandDirection(None),
locked(false),
headerWidget(*this),
enableButton(Gtk::StockID("track_enabled"), WindowManager::MenuIconSize),
lockButton(Gtk::StockID("track_unlocked"), WindowManager::MenuIconSize)
@ -51,8 +53,8 @@ Track::Track(TimelineWidget &timeline_widget,
titleMenuButton.set_relief(RELIEF_HALF);
titleMenuButton.unset_flags(CAN_FOCUS);
buttonBar.append(enableButton);
buttonBar.append(lockButton);
buttonBar.append(enableButton, mem_fun(this, &Track::on_enable));
buttonBar.append(lockButton, mem_fun(this, &Track::on_lock));
headerWidget.set_child_widget(headerBox);
@ -71,6 +73,10 @@ Track::Track(TimelineWidget &timeline_widget,
update_name();
// Setup tooltips
enableButton.set_tooltip_text(_("Disable track"));
lockButton.set_tooltip_text(_("Lock track"));
// Setup the context menu
Menu::MenuList& context_list = contextMenu.items();
//context_list.push_back( Menu_Helpers::MenuElem(_("_Add Track"),
@ -226,6 +232,38 @@ Track::update_name()
titleMenuButton.set_label(model_track->get_name());
}
void
Track::on_enable()
{
enabled = !enabled;
if (enabled)
{
enableButton.set_stock_id(Gtk::StockID("track_enabled"), WindowManager::MenuIconSize);
enableButton.set_tooltip_text(_("Disable track"));
}
else
{
enableButton.set_stock_id(Gtk::StockID("track_disabled"), WindowManager::MenuIconSize);
enableButton.set_tooltip_text(_("Enable track"));
}
}
void
Track::on_lock()
{
locked = !locked;
if (locked)
{
lockButton.set_stock_id(Gtk::StockID("track_locked"), WindowManager::MenuIconSize);
lockButton.set_tooltip_text(_("Unlock track"));
}
else
{
lockButton.set_stock_id(Gtk::StockID("track_unlocked"), WindowManager::MenuIconSize);
lockButton.set_tooltip_text(_("Lock track"));
}
}
void
Track::on_set_name()
{

View file

@ -141,6 +141,8 @@ private:
private:
//----- Event Handlers -----//
void on_enable();
void on_lock();
void on_set_name();
/**
@ -157,12 +159,17 @@ protected:
private:
/**
* True if this track is enabled.
*/
bool enabled;
/**
* This bool is true if this branch is expanded. false if it is
* collapsed.
**/
bool expanded;
/**
* This enum specifies which direction the expand/collapse animation
* is moving - if any.
@ -187,6 +194,11 @@ private:
**/
boost::scoped_ptr<Glib::Timer> expand_timer;
/**
* True if this track is locked.
*/
bool locked;
//----- Header Widgets ------//
timeline::TimelineHeaderWidget headerWidget;

View file

@ -1,6 +1,6 @@
/*
timeline-window.hpp - Implementation of the timeline window object
timeline-view-window.hpp - Implementation of the timeline window object
Copyright (C) Lumiera.org
2008, Joel Holdsworth <joel@airwebreathe.org.uk>

View file

@ -56,6 +56,8 @@ WindowManager::new_window(gui::model::Project &source_project,
windowList.push_back(window);
window->show();
update_close_window_in_menus();
}
bool
@ -89,7 +91,7 @@ WindowManager::on_window_closed(GdkEventAny* event)
shared_ptr<WorkspaceWindow> workspace_window(*iterator);
REQUIRE(workspace_window);
RefPtr<Gdk::Window> window = workspace_window->get_window();
Glib::RefPtr<Gdk::Window> window = workspace_window->get_window();
REQUIRE(window);
if(window->gobj() == event->window)
{
@ -107,30 +109,58 @@ WindowManager::on_window_closed(GdkEventAny* event)
REQUIRE(main);
main->quit();
}
update_close_window_in_menus();
// Unless this is false, the window won't close
return false;
}
GdkColor
WindowManager::read_style_colour_property(
void
WindowManager::update_close_window_in_menus()
{
bool enable = windowList.size() > 1;
list< shared_ptr<WorkspaceWindow> >::iterator iterator =
windowList.begin();
while (iterator != windowList.end())
{
shared_ptr<WorkspaceWindow> workspace_window(*iterator);
REQUIRE(workspace_window);
workspace_window->set_close_window_sensitive(enable);
iterator++;
}
}
Cairo::RefPtr<Cairo::SolidPattern>
WindowManager::read_style_colour_property (
Gtk::Widget &widget, const gchar *property_name,
guint16 red, guint16 green, guint16 blue)
{
GdkColor *colour;
REQUIRE (property_name);
gtk_widget_style_get(widget.gobj(), property_name, &colour, NULL);
// TODO: Can we get rid of the GdkColor completely here?
GdkColor *color;
gtk_widget_style_get(widget.gobj(), property_name, &color, NULL);
Cairo::RefPtr<Cairo::SolidPattern> pattern;
// Did the color load successfully?
if(colour != NULL)
return *colour;
if (color != NULL)
{
pattern = Cairo::SolidPattern::create_rgb ( (double)color->red / 0xFFFF,
(double)color->green / 0xFFFF,
(double)color->blue / 0xFFFF);
}
else
{
WARN(gui, "%s style value failed to load", property_name);
const GdkColor default_colour = {0, red, green, blue};
return default_colour;
}
{
WARN(gui, "%s style value failed to load", property_name);
pattern = Cairo::SolidPattern::create_rgb ( red, green, blue );
}
return pattern;
}
void
@ -145,9 +175,9 @@ WindowManager::register_app_icon_sizes()
void
WindowManager::register_stock_items()
{
RefPtr<IconFactory> factory = IconFactory::create();
Glib::RefPtr<IconFactory> factory = IconFactory::create();
add_stock_icon_set(factory, "panel-resources", "panel_resources", _("_Resources"));
add_stock_icon_set(factory, "panel-assets", "panel_assets", _("_Assets"));
add_stock_icon_set(factory, "panel-timeline", "panel_timeline", _("_Timeline"));
add_stock_icon_set(factory, "panel-viewer", "panel_viewer", _("_Viewer"));
@ -234,7 +264,7 @@ WindowManager::add_theme_icon_source(Gtk::IconSet &icon_set,
REQUIRE(width > 0);
// Try to load the icon
RefPtr<Gtk::IconTheme> theme = Gtk::IconTheme::get_default();
Glib::RefPtr<Gtk::IconTheme> theme = Gtk::IconTheme::get_default();
REQUIRE(theme);
TODO ("find out how IconInfo could be made const. For example, GTKmm 2.10.10 is missing the const on operator bool() in iconinfo.h");

View file

@ -25,6 +25,8 @@
** @see gtk-lumiera.hpp
*/
#include <cairomm/cairomm.h>
#include "gtk-lumiera.hpp"
//#include "workspace/workspace-window.hpp"
@ -81,9 +83,9 @@ public:
* @param blue The fallback blue intensity.
* @return The loaded colour.
**/
static GdkColor read_style_colour_property(
Gtk::Widget &widget, const gchar *property_name,
guint16 red, guint16 green, guint16 blue);
static Cairo::RefPtr<Cairo::SolidPattern>
read_style_colour_property (Gtk::Widget &widget, const gchar *property_name,
guint16 red, guint16 green, guint16 blue);
private:
@ -94,6 +96,15 @@ private:
private:
/**
* On creating and closing of any window, handle enabling or disabling of the
* Window/Close Window menu option.
*
* It should be enabled when there is more than one window and disabled
* otherwise.
**/
void update_close_window_in_menus();
/**
* Registers the custom icon sizes.
**/

View file

@ -49,7 +49,7 @@ Actions::Actions(WorkspaceWindow &workspace_window) :
}
void
Actions::populate_main_actions(RefPtr<Gtk::UIManager> uiManager)
Actions::populate_main_actions(Glib::RefPtr<Gtk::UIManager> uiManager)
{
REQUIRE(uiManager);
@ -90,10 +90,10 @@ Actions::populate_main_actions(RefPtr<Gtk::UIManager> uiManager)
// View Menu
actionGroup->add(Action::create("ViewMenu", _("_View")));
assetsPanelAction = ToggleAction::create("ViewResources",
StockID("panel_resources"));
assetsPanelAction = ToggleAction::create("ViewAssets",
StockID("panel_assets"));
assetsPanelAction->signal_toggled().connect(
mem_fun(*this, &Actions::on_menu_view_resources));
mem_fun(*this, &Actions::on_menu_view_assets));
actionGroup->add(assetsPanelAction);
timelinePanelAction = ToggleAction::create("ViewTimeline",
@ -123,6 +123,9 @@ Actions::populate_main_actions(RefPtr<Gtk::UIManager> uiManager)
actionGroup->add(Action::create("WindowNewWindow",
StockID("new_window")),
mem_fun(*this, &Actions::on_menu_window_new_window));
actionGroup->add(Action::create("WindowCloseWindow",
_("Close Window")),
mem_fun(*this, &Actions::on_menu_window_close_window));
actionGroup->add(Action::create("WindowShowPanel", _("_Show Panel")));
// Help Menu
@ -157,7 +160,7 @@ Actions::populate_main_actions(RefPtr<Gtk::UIManager> uiManager)
" <menuitem action='EditPreferences'/>"
" </menu>"
" <menu action='ViewMenu'>"
" <menuitem action='ViewResources'/>"
" <menuitem action='ViewAssets'/>"
" <menuitem action='ViewTimeline'/>"
" <menuitem action='ViewViewer'/>"
" </menu>"
@ -169,6 +172,7 @@ Actions::populate_main_actions(RefPtr<Gtk::UIManager> uiManager)
" </menu>"
" <menu action='WindowMenu'>"
" <menuitem action='WindowNewWindow'/>"
" <menuitem action='WindowCloseWindow'/>"
" <menu action='WindowShowPanel'/>"
" </menu>"
" <menu action='HelpMenu'>"
@ -204,11 +208,11 @@ Actions::populate_main_actions(RefPtr<Gtk::UIManager> uiManager)
}
void
Actions::populate_show_panel_actions(RefPtr<Gtk::UIManager> uiManager)
Actions::populate_show_panel_actions(Glib::RefPtr<Gtk::UIManager> uiManager)
{
const int count = PanelManager::get_panel_description_count();
RefPtr<Gtk::ActionGroup> actionGroup = ActionGroup::create();
Glib::RefPtr<Gtk::ActionGroup> actionGroup = ActionGroup::create();
for(int i = 0; i < count; i++)
{
const gchar *stock_id = PanelManager::get_panel_stock_id(i);
@ -230,13 +234,13 @@ Actions::populate_show_panel_actions(RefPtr<Gtk::UIManager> uiManager)
void
Actions::update_action_state()
{
/*REQUIRE(workspaceWindow.resourcesPanel != NULL);
/*REQUIRE(workspaceWindow.assetsPanel != NULL);
REQUIRE(workspaceWindow.timelinePanel != NULL);
REQUIRE(workspaceWindow.viewerPanel != NULL);
is_updating_action_state = true;
assetsPanelAction->set_active(
workspaceWindow.resourcesPanel->is_shown());
workspaceWindow.assetsPanel->is_shown());
timelinePanelAction->set_active(
workspaceWindow.timelinePanel->is_shown());
viewerPanelAction->set_active(
@ -249,13 +253,13 @@ Actions::update_action_state()
void
Actions::on_menu_file_new_project()
{
g_message("A File|New menu item was selecteda.");
g_message("A File|New menu item was selected.");
}
void
Actions::on_menu_file_open_project()
{
g_message("A File|Open menu item was selecteda.");
g_message("A File|Open menu item was selected.");
}
void
@ -285,10 +289,10 @@ Actions::on_menu_edit_preferences()
/* ===== View Menu Event Handlers ===== */
void
Actions::on_menu_view_resources()
Actions::on_menu_view_assets()
{
//if(!is_updating_action_state)
// workspaceWindow.resourcesPanel->show(
// workspaceWindow.assetsPanel->show(
// assetsPanelAction->get_active());
}
@ -335,6 +339,13 @@ Actions::on_menu_window_new_window()
workspaceWindow.get_controller());
}
void
Actions::on_menu_window_close_window()
{
workspaceWindow.hide();
// delete &workspaceWindow;
}
void
Actions::on_menu_show_panel(int panel_index)
{

View file

@ -84,7 +84,7 @@ private:
void on_menu_edit_preferences();
void on_menu_view_resources();
void on_menu_view_assets();
void on_menu_view_timeline();
void on_menu_view_viewer();
@ -93,6 +93,7 @@ private:
void on_menu_track_add();
void on_menu_window_new_window();
void on_menu_window_close_window();
void on_menu_show_panel(int panel_index);
void on_menu_help_about();

View file

@ -22,7 +22,7 @@
#include "panel-manager.hpp"
#include "../panels/resources-panel.hpp"
#include "../panels/assets-panel.hpp"
#include "../panels/viewer-panel.hpp"
#include "../panels/timeline-panel.hpp"
@ -39,7 +39,7 @@ const PanelManager::PanelDescription
PanelManager::panelDescriptionList[] = {
PanelManager::Panel<TimelinePanel>(),
PanelManager::Panel<ViewerPanel>(),
PanelManager::Panel<ResourcesPanel>()
PanelManager::Panel<AssetsPanel>()
};
unsigned short PanelManager::panelID = 0;
@ -219,15 +219,15 @@ PanelManager::get_panel_title(int index)
void
PanelManager::create_panels()
{
panels::Panel* resourcesPanel =
create_panel_by_name("ResourcesPanel");
panels::Panel* assetsPanel =
create_panel_by_name("AssetsPanel");
panels::Panel* viewerPanel =
create_panel_by_name("ViewerPanel");
panels::Panel* timelinePanel =
create_panel_by_name("TimelinePanel");
gdl_dock_add_item(dock,
resourcesPanel->get_dock_item(), GDL_DOCK_LEFT);
assetsPanel->get_dock_item(), GDL_DOCK_LEFT);
gdl_dock_add_item(dock,
timelinePanel->get_dock_item(), GDL_DOCK_BOTTOM);
gdl_dock_add_item(dock,

View file

@ -117,7 +117,13 @@ WorkspaceWindow::create_ui()
show_all_children();
}
void
WorkspaceWindow::set_close_window_sensitive(bool enable)
{
uiManager->get_action("/MenuBar/WindowMenu/WindowCloseWindow")
->set_sensitive(enable);
}
} // namespace workspace
} // namespace gui

View file

@ -34,7 +34,7 @@
#include "actions.hpp"
#include "panel-manager.hpp"
#include "../panels/resources-panel.hpp"
#include "../panels/assets-panel.hpp"
#include "../panels/viewer-panel.hpp"
#include "../panels/timeline-panel.hpp"
@ -69,6 +69,8 @@ public:
PanelManager& get_panel_manager();
void set_close_window_sensitive(bool enable);
private:
void create_ui();

View file

@ -44,7 +44,6 @@ liblumiera_la_SOURCES = \
$(liblumiera_la_srcdir)/lockerror.c \
$(liblumiera_la_srcdir)/logging.cpp \
$(liblumiera_la_srcdir)/luid.c \
$(liblumiera_la_srcdir)/lumitime.cpp \
$(liblumiera_la_srcdir)/mpool.c \
$(liblumiera_la_srcdir)/mrucache.c \
$(liblumiera_la_srcdir)/mutex.c \
@ -61,6 +60,8 @@ liblumiera_la_SOURCES = \
$(liblumiera_la_srcdir)/test/test-helper.cpp \
$(liblumiera_la_srcdir)/test/testoption.cpp \
$(liblumiera_la_srcdir)/time.c \
$(liblumiera_la_srcdir)/time/lumitime.cpp \
$(liblumiera_la_srcdir)/time/quantiser.cpp \
$(liblumiera_la_srcdir)/tmpbuf.c \
$(liblumiera_la_srcdir)/util.cpp

View file

@ -36,27 +36,15 @@ namespace lumiera {
/**
* C++ convenience wrapper representing a time value, which could denote
* a temporal position (time point) relative to an (implicit) timeline zero
* point, or it could represent a time interval.
* Lumiera's internal time data.
* Time denotes a time point, specified as opaque value on an
* quasi continuous ("sufficiently precise") internal time scale, relative
* to an (implicit) timeline zero point. The actual implementation relies
* on gavl_time_t (long) values.
*
* This wrapper is deliberately kept rather limited as not to be completely
* interchangeable with and integral type. The rationale is that time values
* should be kept separate and tagged as time values. The following is supported:
* - conversions from / to gavl_time_t (which is effectively a int64_t)
* - additions and subtractions of time values
* - multiplication with an integral factor
* - comparisons between time values and gavl_time_t values
* @see lib::time::TimeVar for an number-like time value usable for calculations
*
* @todo consider the possible extensions
* - parsing and pretty printing
* - quantising of floating point values
* - conversion to boost::rational
* - define a Framerate type
*
* @note this is currently (10/08) an experimental implementation to ease
* the time handling within C++ code. It is advisable not to use it
* on external interfaces (use gavl_time_t there please).
* @todo it is not clear to which degree Time is mutable...
*/
class Time
: boost::additive<Time,

View file

@ -22,6 +22,8 @@
#include "lib/lumitime.hpp"
#include "lib/time/timevalue.hpp"
extern "C" {
#include "lib/time.h"
}
@ -39,7 +41,7 @@ namespace lumiera {
const Time Time::MIN ( -std::numeric_limits<int64_t>::max() );
Time::Time ( long millis
, uint secs
, uint mins
@ -47,7 +49,7 @@ namespace lumiera {
)
: t_(lumiera_build_time (millis,secs,mins,hours))
{ }
int
Time::getMillis() const
{
@ -81,7 +83,7 @@ namespace lumiera {
// TODO
return 0;
}
Time::operator string() const
{

View file

@ -0,0 +1,39 @@
/*
Quantiser - aligning time values to a time grid
Copyright (C) Lumiera.org
2010, 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.
* *****************************************************/
#include "lib/lumitime.hpp"
#include "lib/time/timevalue.hpp"
using std::string;
namespace lib {
namespace time {
/** */
}} // lib::time

View file

@ -0,0 +1,49 @@
/*
QUANTISER.hpp - aligning time values to a time grid
Copyright (C) Lumiera.org
2010, 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.
*/
#ifndef LIB_TIME_QUANTISER_H
#define LIB_TIME_QUANTISER_H
//#include <boost/operators.hpp>
#include <string>
namespace lib {
namespace time {
/**
* Facility to create grid-aligned time values.
*
* @todo WIP-WIP-WIP
*/
class Quantiser
{
public:
};
}} // lib::time
#endif

49
src/lib/time/timecode.hpp Normal file
View file

@ -0,0 +1,49 @@
/*
TIMECODE.hpp - grid aligned and fixed format time specifications
Copyright (C) Lumiera.org
2010, 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.
*/
#ifndef LIB_TIME_TIMECODE_H
#define LIB_TIME_TIMECODE_H
//#include <boost/operators.hpp>
#include <string>
namespace lib {
namespace time {
/**
* fixed format time specification.
*
* @todo WIP-WIP-WIP
*/
class TCode
{
public:
};
}} // lib::time
#endif

163
src/lib/time/timevalue.hpp Normal file
View file

@ -0,0 +1,163 @@
/*
TIMEVALUE.hpp - basic definitions for time values and time intervals
Copyright (C) Lumiera.org
2010, 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.
*/
#ifndef LIB_TIME_TIMEVALUE_H
#define LIB_TIME_TIMEVALUE_H
#include <boost/operators.hpp>
#include <string>
extern "C" {
#include <stdint.h>
#include <gavl/gavltime.h>
}
namespace lib {
namespace time {
using lumiera::Time;
/**
* fixed format time specification.
*
* @todo WIP-WIP-WIP
*/
class TimeValue
: boost::totally_ordered<Time,
boost::totally_ordered<Time, gavl_time_t> >
{
protected:
gavl_time_t t_;
public:
static const Time MAX ;
static const Time MIN ;
explicit
TimeValue (gavl_time_t val=0)
: t_(val)
{ }
// using standard copy operations
operator gavl_time_t () const { return t_; }
// Supporting totally_ordered
friend bool operator< (TimeValue const& t1, TimeValue const& t2) { return t1.t_ < t2.t_; }
friend bool operator< (TimeValue const& t1, gavl_time_t t2) { return t1.t_ < t2 ; }
friend bool operator> (TimeValue const& t1, gavl_time_t t2) { return t1.t_ > t2 ; }
friend bool operator== (TimeValue const& t1, TimeValue const& t2) { return t1.t_ == t2.t_; }
friend bool operator== (TimeValue const& t1, gavl_time_t t2) { return t1.t_ == t2 ; }
};
class TimeVar
: public TimeValue
, boost::additive<TimeVar>
{
public:
TimeVar (TimeValue time)
: TimeValue(time)
{ }
// Supporting additive
TimeVar& operator+= (TimeVar const& tx) { t_ += tx.t_; return *this; }
TimeVar& operator-= (TimeVar const& tx) { t_ -= tx.t_; return *this; }
// Supporting multiplication with integral factor
TimeVar& operator*= (int64_t fact) { t_ *= fact; return *this; }
// baseclass TimeValue is already totally_ordered
};
class Offset;
/**
* Lumiera's internal time value datatype
*/
//class Time
// : public TimeValue
// {
// public:
// explicit
// Time (TimeValue val=0)
// : TimeValue(val)
// { }
//
// Time ( long millis
// , uint secs
// , uint mins =0
// , uint hours=0
// );
// };
class Offset
: public TimeValue
{
public:
explicit
Offset (TimeValue distance)
: TimeValue(distance)
{ }
};
inline Offset
operator- (Time const& end, Time const& start)
{
// TimeVar distance(end);
// distance -= start;
// return Offset(distance);
}
typedef const Offset TimeDistance;
class Duration
: public TimeValue
{
// always positive
};
class TimeSpan
: public Time
{
Duration dur_;
public:
TimeSpan(Time start, Duration length)
: Time(start)
, dur_(length)
{ }
};
}} // lib::time
#endif

View file

@ -108,9 +108,11 @@ liblumiprocmobjectbuilder_la_CXXFLAGS = $(AM_CXXFLAGS) $(LUMIERA_PROC_CFLAGS) -W
liblumiprocmobjectbuilder_la_SOURCES = \
$(liblumiprocmobjectbuilder_la_srcdir)/assembler.cpp \
$(liblumiprocmobjectbuilder_la_srcdir)/conmanager.cpp \
$(liblumiprocmobjectbuilder_la_srcdir)/model-port-registry.cpp \
$(liblumiprocmobjectbuilder_la_srcdir)/operationpoint.cpp \
$(liblumiprocmobjectbuilder_la_srcdir)/nodecreatortool.cpp \
$(liblumiprocmobjectbuilder_la_srcdir)/segmentation.cpp \
$(liblumiprocmobjectbuilder_la_srcdir)/segmentation-tool.cpp \
$(liblumiprocmobjectbuilder_la_srcdir)/segmentation.cpp \
$(liblumiprocmobjectbuilder_la_srcdir)/toolfactory.cpp

View file

@ -627,12 +627,27 @@ return: 0
END
TEST "Time Wrapper" TimeWrapper_test <<END
TEST "Lumiera Time Wrapper" LumiTime_test <<END
out: ..:..:..\....
return: 0
END
PLANNED "Times and time intervals" TimeValue_test <<END
return: 0
END
PLANNED "Time Quantisation" TimeQuantisation_test <<END
return: 0
END
PLANNED "Time formats and timecodes" TimeFormats_test <<END
return: 0
END
TEST "Symbol_test" Symbol_test <<END
out: one
out: sizeof.+lib.Literal.+ = (4|8)

22
tests/51-gui-model.tests Normal file
View file

@ -0,0 +1,22 @@
TESTING "Component Test Suite: GUI Model Parts" ./test-components --group=gui
PLANNED "ModelClipTrack_test" ModelClipTrack_test <<END
END
PLANNED "ModelClip_test" ModelClip_test <<END
END
PLANNED "ModelGroupTrack_test" ModelGroupTrack_test <<END
END
PLANNED "ModelParentTrack_test" ModelParentTrack_test <<END
END
PLANNED "ModelProject_test" ModelProject_test <<END
END
PLANNED "ModelSequence_test" ModelSequence_test <<END
END
PLANNED "ModelTrack_test" ModelTrack_test <<END
END

View file

@ -102,7 +102,10 @@ test_lib_SOURCES = \
$(testlib_srcdir)/test/testoptiontest.cpp \
$(testlib_srcdir)/thread-wrapper-join-test.cpp \
$(testlib_srcdir)/thread-wrapper-test.cpp \
$(testlib_srcdir)/time-wrapper-test.cpp \
$(testlib_srcdir)/lumitime-test.cpp \
$(testlib_srcdir)/time/time-value-test.cpp \
$(testlib_srcdir)/time/time-quantisation-test.cpp \
$(testlib_srcdir)/time/time-formats-test.cpp \
$(testlib_srcdir)/typed-allocation-manager-test.cpp \
$(testlib_srcdir)/typed-counter-test.cpp \
$(testlib_srcdir)/util-foreach-test.cpp \

View file

@ -1,5 +1,5 @@
/*
TimeWrapper(Test) - working with gavl_time_t values in C++...
LumiTime(Test) - working with Lumiera's internal Time values
Copyright (C) Lumiera.org
2008, Hermann Vosseler <Ichthyostega@web.de>
@ -47,7 +47,7 @@ namespace test {
/********************************************
* @test sanity of the C++ time wrapper.
*/
class TimeWrapper_test : public Test
class LumiTime_test : public Test
{
virtual void
run (Arg arg)
@ -166,7 +166,7 @@ namespace test {
/** Register this test class... */
LAUNCHER (TimeWrapper_test, "unit common");
LAUNCHER (LumiTime_test, "unit common");

View file

@ -0,0 +1,92 @@
/*
TimeFormats(Test) - timecode handling and formatting
Copyright (C) Lumiera.org
2010, 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.
* *****************************************************/
#include "lib/test/run.hpp"
#include "lib/time/timecode.hpp"
#include "lib/util.hpp"
#include <boost/lexical_cast.hpp>
//#include <iostream>
//#include <cstdlib>
using boost::lexical_cast;
using util::isnil;
//using std::rand;
//using std::cout;
//using std::endl;
namespace lib {
namespace time{
namespace test{
using lumiera::Time;
/********************************************************
* @test verify handling of grid aligned timecode values.
* - creating timecode values
* - some conversions
* - formatting
*/
class TimeFormats_test : public Test
{
virtual void
run (Arg arg)
{
long refval= isnil(arg)? 1 : lexical_cast<long> (arg[1]);
Time ref (refval);
checkBasics (ref);
checkComparisons (ref);
checkComponentAccess();
}
void
checkBasics (Time const& ref)
{
}
void
checkComparisons (Time const& ref)
{
}
void
checkComponentAccess()
{
}
};
/** Register this test class... */
LAUNCHER (TimeFormats_test, "unit common");
}}} // namespace lib::time::test

View file

@ -0,0 +1,92 @@
/*
TimeQuantisation(Test) - handling of virtually grid aligned time values
Copyright (C) Lumiera.org
2010, 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.
* *****************************************************/
#include "lib/test/run.hpp"
#include "lib/time/quantiser.hpp"
#include "lib/util.hpp"
#include <boost/lexical_cast.hpp>
//#include <iostream>
//#include <cstdlib>
using boost::lexical_cast;
using util::isnil;
//using std::rand;
//using std::cout;
//using std::endl;
namespace lib {
namespace time{
namespace test{
using lumiera::Time;
/********************************************************
* @test verify handling of time values, time intervals.
* - creating times and time intervals
* - comparisons
* - time arithmetics
*/
class TimeQuantisation_test : public Test
{
virtual void
run (Arg arg)
{
long refval= isnil(arg)? 1 : lexical_cast<long> (arg[1]);
Time ref (refval);
checkBasics (ref);
checkComparisons (ref);
checkComponentAccess();
}
void
checkBasics (Time const& ref)
{
}
void
checkComparisons (Time const& ref)
{
}
void
checkComponentAccess()
{
}
};
/** Register this test class... */
LAUNCHER (TimeQuantisation_test, "unit common");
}}} // namespace lib::time::test

View file

@ -0,0 +1,90 @@
/*
TimeValue(Test) - working with time values and time intervals in C++...
Copyright (C) Lumiera.org
2010, 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.
* *****************************************************/
#include "lib/test/run.hpp"
#include "lib/time/timevalue.hpp"
#include "lib/util.hpp"
#include <boost/lexical_cast.hpp>
//#include <iostream>
//#include <cstdlib>
using boost::lexical_cast;
using util::isnil;
//using std::rand;
//using std::cout;
//using std::endl;
namespace lib {
namespace time{
namespace test{
/********************************************************
* @test verify handling of time values, time intervals.
* - creating times and time intervals
* - comparisons
* - time arithmetics
*/
class TimeValue_test : public Test
{
virtual void
run (Arg arg)
{
long refval= isnil(arg)? 1 : lexical_cast<long> (arg[1]);
Time ref (refval);
checkBasics (ref);
checkComparisons (ref);
checkComponentAccess();
}
void
checkBasics (Time const& ref)
{
}
void
checkComparisons (Time const& ref)
{
}
void
checkComponentAccess()
{
}
};
/** Register this test class... */
LAUNCHER (TimeValue_test, "unit common");
}}} // namespace lib::time::test

View file

@ -1,6 +1,6 @@
format 58
"CommonLib" // CommonLib
revision 20
revision 22
modified_by 5 "hiv"
// class settings
//class diagram settings
@ -811,6 +811,380 @@ ${items}};
end
end
classview 135685 "Time Handling"
//class diagram settings
draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_infonote default shadow default show_stereotype_properties default
//collaboration diagram settings
show_full_operations_definition default show_hierarchical_rank default write_horizontally default drawing_language default package_name_in_tab default show_context default draw_all_relations default shadow default show_stereotype_properties default
//object diagram settings
write_horizontally default package_name_in_tab default show_context default auto_label_position default draw_all_relations default shadow default show_stereotype_properties default
//sequence diagram settings
show_full_operations_definition default write_horizontally default class_drawing_mode default drawing_language default draw_all_relations default shadow default show_stereotype_properties default
//state diagram settings
package_name_in_tab default show_context default auto_label_position default write_trans_label_horizontally default show_trans_definition default draw_all_relations default shadow default
show_activities default region_horizontally default drawing_language default show_stereotype_properties default
//class settings
//activity diagram settings
package_name_in_tab default show_context default show_opaque_action_definition default auto_label_position default write_flow_label_horizontally default draw_all_relations default shadow default
show_infonote default drawing_language default show_stereotype_properties default
classdiagram 142725 "Time flavours"
draw_all_relations no hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_infonote default shadow default show_stereotype_properties default
size A4
end
class 134917 "Time"
visibility public
cpp_decl "${comment}${template}class ${name}${inherit}
{
${members} };
${inlines}
"
java_decl ""
php_decl ""
python_2_2 python_decl ""
idl_decl ""
explicit_switch_type ""
comment "denotes a temporal position (time point) in continuous time.
This implies a time origin (point of reference), which is kept implicit and depends on the context.
"
classrelation 206085 // <generalisation>
relation 195205 ---|>
a public
cpp default "${type}"
classrelation_ref 206085 // <generalisation>
b parent class_ref 168709 // TimeValue
end
end
class 168581 "TimeSpan"
visibility package
cpp_decl "${comment}${template}class ${name}${inherit}
{
${members} };
${inlines}
"
java_decl ""
php_decl ""
python_2_2 python_decl ""
idl_decl ""
explicit_switch_type ""
classrelation 206341 // <generalisation>
relation 195461 ---|>
a public
cpp default "${type}"
classrelation_ref 206341 // <generalisation>
b parent class_ref 168837 // Duration
end
classrelation 206469 // start (<unidirectional association>)
relation 195589 --->
a role_name "start" protected
cpp default " ${comment}${static}${mutable}${volatile}${const}${type}* ${name}${value};
"
classrelation_ref 206469 // start (<unidirectional association>)
b parent class_ref 134917 // Time
end
end
class 168709 "TimeValue"
visibility package
cpp_decl "${comment}${template}class ${name}${inherit}
{
${members} };
${inlines}
"
java_decl ""
php_decl ""
python_2_2 python_decl ""
idl_decl ""
explicit_switch_type ""
end
class 168837 "Duration"
visibility package
cpp_decl "${comment}${template}class ${name}${inherit}
{
${members} };
${inlines}
"
java_decl ""
php_decl ""
python_2_2 python_decl ""
idl_decl ""
explicit_switch_type ""
classrelation 206213 // <generalisation>
relation 195333 ---|>
a public
cpp default "${type}"
classrelation_ref 206213 // <generalisation>
b parent class_ref 168709 // TimeValue
end
end
class 168965 "QuTime"
visibility package
cpp_decl "${comment}${template}class ${name}${inherit}
{
${members} };
${inlines}
"
java_decl ""
php_decl ""
python_2_2 python_decl ""
idl_decl ""
explicit_switch_type ""
classrelation 206853 // <unidirectional association>
relation 195973 --->
stereotype "refers_to"
a role_name "" multiplicity "1" protected
cpp default " ${comment}${static}${mutable}${volatile}${const}${type}* ${name}${value};
"
classrelation_ref 206853 // <unidirectional association>
b multiplicity "*" parent class_ref 169093 // Quantiser
end
classrelation 208133 // <generalisation>
relation 197253 ---|>
a public
cpp default "${type}"
classrelation_ref 208133 // <generalisation>
b parent class_ref 134917 // Time
end
classrelation 208901 // <unidirectional association>
relation 198021 --->
stereotype "yield"
a role_name "" protected
cpp default " ${comment}${static}${mutable}${volatile}${const}${type}* ${name}${value};
"
classrelation_ref 208901 // <unidirectional association>
b parent class_ref 170629 // TCode
end
end
class 169093 "Quantiser"
visibility package
cpp_decl "${comment}${template}class ${name}${inherit}
{
${members} };
${inlines}
"
java_decl ""
php_decl ""
python_2_2 python_decl ""
idl_decl ""
explicit_switch_type ""
classrelation 206981 // <unidirectional association>
relation 196101 --->
stereotype "use"
a role_name "" multiplicity "1" protected
cpp default " ${comment}${static}${mutable}${volatile}${const}${type}* ${name}${value};
"
classrelation_ref 206981 // <unidirectional association>
b parent class_ref 169221 // TimeGrid
end
classrelation 209029 // <directional aggregation>
relation 198149 o-->
stereotype "provide"
a role_name "" protected
cpp default " ${comment}${static}${mutable}${volatile}${const}${type}* ${name}${value};
"
classrelation_ref 209029 // <directional aggregation>
b parent class_ref 170757 // Format
end
end
class 169221 "TimeGrid"
visibility package
cpp_decl "${comment}${template}class ${name}${inherit}
{
${members} };
${inlines}
"
java_decl ""
php_decl ""
python_2_2 python_decl ""
idl_decl ""
explicit_switch_type ""
attribute 134277 "origin"
protected type class_ref 134917 // Time
multiplicity "1"
cpp_decl " ${comment}${static}${mutable}${volatile}${const}${type} ${name}${value};
"
java_decl ""
php_decl ""
python_decl ""
idl_decl ""
end
attribute 134405 "scale"
protected type class_ref 168837 // Duration
cpp_decl " ${comment}${static}${mutable}${volatile}${const}${type} ${name}${value};
"
java_decl ""
php_decl ""
python_decl ""
idl_decl ""
end
end
class 170373 "TimeVar"
visibility package
cpp_decl "${comment}${template}class ${name}${inherit}
{
${members} };
${inlines}
"
java_decl ""
php_decl ""
python_2_2 python_decl ""
idl_decl ""
explicit_switch_type ""
classrelation 208261 // <generalisation>
relation 197381 ---|>
a public
cpp default "${type}"
classrelation_ref 208261 // <generalisation>
b parent class_ref 168709 // TimeValue
end
classrelation 208389 // val (<unidirectional association>)
relation 197509 --->
a role_name "val" multiplicity "1" protected
cpp default " ${comment}${static}${mutable}${volatile}${const}${type}* ${name}${value};
"
classrelation_ref 208389 // val (<unidirectional association>)
b multiplicity "*" parent class_ref 134917 // Time
end
end
class 170501 "QuTimeSpan"
visibility package
cpp_decl "${comment}${template}class ${name}${inherit}
{
${members} };
${inlines}
"
java_decl ""
php_decl ""
python_2_2 python_decl ""
idl_decl ""
explicit_switch_type ""
classrelation 208517 // <generalisation>
relation 197637 ---|>
a public
cpp default "${type}"
classrelation_ref 208517 // <generalisation>
b parent class_ref 168581 // TimeSpan
end
end
class 170629 "TCode"
visibility package
nformals 1
formal name "F" type "class" explicit_default_value ""
explicit_extends ""
cpp_decl "${comment}${template}class ${name}${inherit}
{
${members} };
${inlines}
"
java_decl ""
php_decl ""
python_2_2 python_decl ""
idl_decl ""
explicit_switch_type ""
classrelation 208645 // <dependency>
relation 197765 -_->
a default
cpp default "#include in source"
classrelation_ref 208645 // <dependency>
b parent class_ref 170629 // TCode
end
classrelation 208773 // <dependency>
relation 197893 -_->
a default
cpp default "#include in source"
classrelation_ref 208773 // <dependency>
b parent class_ref 170757 // Format
end
end
class 170757 "Format"
visibility package
cpp_decl "${comment}${template}class ${name}${inherit}
{
${members} };
${inlines}
"
java_decl ""
php_decl ""
python_2_2 python_decl ""
idl_decl ""
explicit_switch_type ""
end
class 170885 "FrameNr"
visibility package
nactuals 1
actual class class_ref 170629 // TCode
rank 0 explicit_value ""
cpp_decl "${comment}${template}class ${name}${inherit}
{
${members} };
${inlines}
"
java_decl ""
php_decl ""
python_2_2 python_decl ""
idl_decl ""
explicit_switch_type ""
classrelation 209157 // <generalisation>
relation 198277 ---|>
a public
cpp default "${type}"
classrelation_ref 209157 // <generalisation>
b parent class_ref 170629 // TCode
end
end
class 171013 "CompoundGrid"
visibility package
cpp_decl "${comment}${template}class ${name}${inherit}
{
${members} };
${inlines}
"
java_decl ""
php_decl ""
python_2_2 python_decl ""
idl_decl ""
explicit_switch_type ""
classrelation 209285 // <generalisation>
relation 198405 ---|>
a public
cpp default "${type}"
classrelation_ref 209285 // <generalisation>
b parent class_ref 169221 // TimeGrid
end
end
end
package_ref 131077 // ConfigQuery
package_ref 132485 // Containers
@ -1161,24 +1535,6 @@ ${inlines}
end
end
class 134917 "Time"
visibility public
cpp_decl "${comment}${template}class ${name}${inherit}
{
${members} };
${inlines}
"
java_decl ""
php_decl ""
python_2_2 python_decl ""
idl_decl ""
explicit_switch_type ""
comment "denotes a temporal position (time point), based on timeline start.
investigate posix.4 realtime timers, wrap these here"
end
class 135301 "Factory"
visibility public
nformals 1

View file

@ -1,6 +1,6 @@
format 58
"ConfigQuery" // CommonLib::ConfigQuery
revision 18
revision 19
modified_by 5 "hiv"
// class settings
//class diagram settings

View file

@ -1,6 +1,6 @@
format 58
"Containers" // CommonLib::Containers
revision 1
revision 2
modified_by 5 "hiv"
// class settings
//class diagram settings

142
uml/lumiera/142725.diagram Normal file
View file

@ -0,0 +1,142 @@
format 58
classcanvas 128005 class_ref 134917 // Time
draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_infonote default shadow default show_stereotype_properties default
xyz 249 118 2000
end
classcanvas 128133 class_ref 168581 // TimeSpan
draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_infonote default shadow default show_stereotype_properties default
xyz 38 218 2000
end
classcanvas 128261 class_ref 168709 // TimeValue
draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_infonote default shadow default show_stereotype_properties default
xyz 36 24 2000
end
classcanvas 128389 class_ref 168837 // Duration
draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_infonote default shadow default show_stereotype_properties default
xyz 42 118 2000
end
classcanvas 129669 class_ref 168965 // QuTime
draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_infonote default shadow default show_stereotype_properties default
xyz 245 324 2000
end
classcanvas 130181 class_ref 169093 // Quantiser
draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_infonote default shadow default show_stereotype_properties default
xyz 393 324 2000
end
classcanvas 130565 class_ref 169221 // TimeGrid
draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_infonote default shadow default show_stereotype_properties default
xyz 508 324 2000
end
classcanvas 130949 class_ref 170373 // TimeVar
draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_infonote default shadow default show_stereotype_properties default
xyz 114 118 2000
end
classcanvas 131589 class_ref 170501 // QuTimeSpan
draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_infonote default shadow default show_stereotype_properties default
xyz 103 324 2000
end
classcanvas 131973 class_ref 170629 // TCode
draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_infonote default shadow default show_stereotype_properties default
xyz 248 413 2000
end
classcanvas 132101 class_ref 170757 // Format
draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_infonote default shadow default show_stereotype_properties default
xyz 393 397 2000
end
classcanvas 132997 class_ref 170885 // FrameNr
draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_infonote default shadow default show_stereotype_properties default
xyz 238 496 2000
end
classcanvas 133253 class_ref 171013 // CompoundGrid
draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_infonote default shadow default show_stereotype_properties default
xyz 480 439 2000
end
relationcanvas 128517 relation_ref 195205 // <generalisation>
geometry VHV unfixed
from ref 128005 z 1999 to point 269 88
line 128645 z 1999 to point 66 88
line 128773 z 1999 to ref 128261
no_role_a no_role_b
no_multiplicity_a no_multiplicity_b
end
relationcanvas 128901 relation_ref 195333 // <generalisation>
from ref 128389 z 1999 to ref 128261
no_role_a no_role_b
no_multiplicity_a no_multiplicity_b
end
relationcanvas 129285 relation_ref 195461 // <generalisation>
from ref 128133 z 1999 to ref 128389
no_role_a no_role_b
no_multiplicity_a no_multiplicity_b
end
relationcanvas 129413 relation_ref 195589 // <unidirectional association>
from ref 128133 z 1999 to ref 128005
role_a_pos 111 214 3000 no_role_b
no_multiplicity_a no_multiplicity_b
end
relationcanvas 130437 relation_ref 195973 // <unidirectional association>
from ref 129669 z 1999 stereotype "<<refers_to>>" xyz 309 330 3000 to ref 130181
no_role_a no_role_b
multiplicity_a_pos 376 349 3000 multiplicity_b_pos 305 349 3000
end
relationcanvas 130693 relation_ref 196101 // <unidirectional association>
decenter_end 353
from ref 130181 z 1999 stereotype "<<use>>" xyz 457 333 3000 to ref 130565
no_role_a no_role_b
multiplicity_a_pos 491 352 3000 no_multiplicity_b
end
relationcanvas 130821 relation_ref 197253 // <generalisation>
from ref 129669 z 1999 to ref 128005
no_role_a no_role_b
no_multiplicity_a no_multiplicity_b
end
relationcanvas 131077 relation_ref 197381 // <generalisation>
geometry VHV
from ref 130949 z 1999 to point 138 88
line 131205 z 1999 to point 66 88
line 131333 z 1999 to ref 128261
no_role_a no_role_b
no_multiplicity_a no_multiplicity_b
end
relationcanvas 131461 relation_ref 197509 // <unidirectional association>
from ref 130949 z 1999 to ref 128005
role_a_pos 175 124 3000 no_role_b
multiplicity_a_pos 230 140 3000 multiplicity_b_pos 176 143 3000
end
relationcanvas 131717 relation_ref 197637 // <generalisation>
from ref 131589 z 1999 to point 65 290
line 131845 z 1999 to ref 128133
no_role_a no_role_b
no_multiplicity_a no_multiplicity_b
end
relationcanvas 132485 relation_ref 197893 // <dependency>
from ref 131973 z 1999 to point 290 413
line 132869 z 1999 to ref 132101
no_role_a no_role_b
no_multiplicity_a no_multiplicity_b
end
relationcanvas 132613 relation_ref 198021 // <unidirectional association>
from ref 129669 z 1999 stereotype "<<yield>>" xyz 275 378 3000 to ref 131973
no_role_a no_role_b
no_multiplicity_a no_multiplicity_b
end
relationcanvas 132741 relation_ref 198149 // <directional aggregation>
decenter_end 595
from ref 130181 z 1999 stereotype "<<provide>>" xyz 360 377 3000 to ref 132101
no_role_a no_role_b
no_multiplicity_a no_multiplicity_b
end
relationcanvas 133125 relation_ref 198277 // <generalisation>
decenter_begin 581
from ref 132997 z 1999 to ref 131973
no_role_a no_role_b
no_multiplicity_a no_multiplicity_b
end
relationcanvas 133381 relation_ref 198405 // <generalisation>
decenter_begin 658
from ref 133253 z 1999 to ref 130565
no_role_a no_role_b
no_multiplicity_a no_multiplicity_b
end
end

View file

@ -4,10 +4,8 @@ diagrams
631 352 100 4 0 0
objectdiagram_ref 138885 // ModelAssetRelations
730 488 100 4 0 0
classdiagram_ref 128133 // Session structure
835 697 100 4 300 0
active activitydiagram_ref 129413 // build flow
627 621 100 4 0 0
active classdiagram_ref 142725 // Time flavours
595 629 100 4 0 0
end
show_stereotypes
selected
@ -36,15 +34,10 @@ open
expansionregion_ref 128133 // establish partitioning
usecaseview_ref 128261 // config examples
classview_ref 128133 // Engine Workings
class_ref 164485 // Request
class_ref 164613 // Provision
class_ref 166021 // ActiveProvision
class_ref 164741 // Binding
class_ref 166277 // Index
class_ref 145285 // MediaKind
package_ref 131077 // ConfigQuery
class_ref 152965 // Handle
classdiagram_ref 142725 // Time flavours
class_ref 134917 // Time
class_ref 169221 // TimeGrid
classview_ref 128645 // Service Components
classview_ref 128266 // SmartPointers
end
end

View file

@ -1,6 +1,6 @@
format 58
"lumiera"
revision 65
revision 66
modified_by 5 "hiv"
cpp_root_dir "../../src/"

View file

@ -2081,7 +2081,7 @@ Besides routing to a global pipe, wiring plugs can also connect to the source po
Finally, this example shows an ''automation'' data set controlling some parameter of an effect contained in one of the global pipes. From the effect's POV, the automation is simply a ParamProvider, i.e a function yielding a scalar value over time. The automation data set may be implemented as a bézier curve, or by a mathematical function (e.g. sine or fractal pseudo random) or by some captured and interpolated data values. Interestingly, in this example the automation data set has been placed relatively to the meta clip (albeit on another track), thus it will follow and adjust when the latter is moved.
</pre>
</div>
<div title="ImplementationDetails" modifier="Ichthyostega" modified="201011190301" created="200708080322" tags="overview" changecount="39">
<div title="ImplementationDetails" modifier="Ichthyostega" modified="201012192119" created="200708080322" tags="overview" changecount="41">
<pre>This wiki page is the entry point to detail notes covering some technical decisions, details and problems encountered in the course of the implementation of the Lumiera Renderengine, the Builder and the related parts.
* [[Packages, Interfaces and Namespaces|InterfaceNamespaces]]
@ -2110,6 +2110,10 @@ Finally, this example shows an ''automation'' data set controlling some paramete
* shaping the GUI/~Proc-Interface, based on MObjectRef and the [[Command frontend|CommandHandling]]
* defining PlacementScope in order to allow for [[discovering session contents|Query]]
* working out a [[Wiring concept|Wiring]] and the foundations of OutputManagement
* shaping the foundations of the [[player subsystem|Player]]
* detail considerations regarding [[time and time quantisation|TimeQuant]]
* designing how to [[build|BuildFixture]] the [[Fixture]] (...{{red{WIP}}}...)
</pre>
</div>
<div title="ImplementationGuidelines" modifier="Ichthyostega" modified="201011190306" created="200711210531" tags="Concepts design discuss" changecount="17">
@ -3970,6 +3974,33 @@ We need a way of addressing existing [[pipes|Pipe]]. Besides, as the Pipes and T
&lt;&lt;tasksum end&gt;&gt;
</pre>
</div>
<div title="PlayProcess" modifier="Ichthyostega" modified="201012181732" created="201012181714" tags="def spec Player" changecount="2">
<pre>With //play process//&amp;nbsp; we denote an ongoing effort to calculate a stream of frames for playback or rendering.
The play process is an conceptual entity linking together several activities in the [[Backend]] and the RenderEngine. Creating a play process is the central service provided by the [[player subsystem|Player]]: it maintains a registration entry for the process to keep track of associated entities, resources allocated and calls dispatched as a consequence, and it wires and exposes a PlayController to serve as an interface and information hub.
''Note'': the player is in no way engaged in any of the actual calculation and management tasks necessary to make this stream of calculations happen. The play process code contained within the player subsystem is largely comprised of organisational concerns and not especially performance critical.
* the [[Backend]] is responsible for scheduling and dispatching the calculations
* the RenderEngine has the ability to cary out individual frame calculations
* the OutputSlot exposed by the [[output manager|OutputManagement]] is responsible for accepting timed frame delivery</pre>
</div>
<div title="Player" modifier="Ichthyostega" modified="201012181726" created="201012181700" tags="def overview" changecount="8">
<pre>Within Lumiera, &amp;raquo;Player&amp;laquo; denotes the [[Subsystem]] responsible for organising and tracking //ongoing playback and render processes.// &amp;rarr; [[PlayProcess]]
The player subsystem does not perform or even manage any render operations, nor does it handle the outputs directly.
Yet it adresses some central concerns:
;uniformity
:all playback and render processes are on equal footing, handled in a similar way.
;integration
:the player cares for the necessary integration with the other subsystems
:it consults the OutputManagement, retrieves the necessary informations from the [[Session]] and coordinates [[Backend]] calls.
;time quantisation
:the player translates continuous time values into discrete frame counts.
:to perform this [[quantisation|TimeQuant]], the help of the session for building a TimeGrid for each output channel is required.
!{{red{WIP 12/10}}} under construction
The player subsystem is currently about to be designed and built up; some time ago, __Joel Holdsworth__ and __Ichthyo__ did a design study with a PlayerDummy, which is currently hooked up with the TransportControl in the Lumiera GUI.
</pre>
</div>
<div title="PlayerDummy" modifier="Ichthyostega" modified="200906071810" created="200901300209" tags="GuiIntegration operational img" changecount="17">
<pre>__Joelholdsworth__ and __Ichthyo__ created this player mockup in 1/2009 to find out about the implementation details regarding integration and colaboration between the layers. There is no working render engine yet, thus we use a ~DummyImageGenerator for creating faked yuv frames to display. Within the GUI, there is a ~PlaybackController hooked up with the transport controls on the timeline pane.
# first everything was contained within ~PlaybackController, which spawns a thread for periodically creating those dummy frames
@ -6493,6 +6524,128 @@ function addKeyDownHandlers(e)
Thus no server and no network connection is needed. Simply open the file in your browser and save changes locally. As the [[Proc-Layer wiki|ProcLayer and Engine]] HTML is located in the Lumiera source tree, all changes will be managed and distributed via GIT. While doing so, you sometimes will have to merge conflicing changes manually in the HTML source.
* see GettingStarted
* see [[Homepage|http://tiddlywiki.com]], [[Wiki-Markup|http://tiddlywiki.org/wiki/TiddlyWiki_Markup]]
</pre>
</div>
<div title="TimeQuant" modifier="Ichthyostega" modified="201012230154" created="201012181753" tags="Concepts Player spec discuss draft" changecount="45">
<pre>The term &amp;raquo;Time&amp;laquo; spans a variety of vastly different entities. Within a NLE we get to deal with various //flavours of time values.//
;continuous time
:without any additional assumptions, ''points in time'' can be specified with arbitrary precision.
:the time values are just numbers; the point of reference and the meaning is implicit.
:within Lumiera, time is encoded as integral number of //micro ticks,// practically continuous
;duration
:a range of time, a ''distance'' on the time axis, measured with the same arbitrary precision as time points.
:distances and durations can be determined by //subtracting// two time points, consequently they are //signed numbers.//
:a duration always abstracts from the time //when// this duration or distance happens, the relation to any time scale remains implicit
;offset
:offsetting a time or a duration is an operation (not an entity): it means changing the denoted time point or duration.
:the //target// of an offset operation is a time or duration, while it's //argument// is a distance (synonymous to duration).
:Time values are //immutable,// like numbers. Only a ''time variable'' can be changed. Durations to the contrary can be mutable or const.
;time span
:contrary to a mere duration, a ''time interval'' or time span is actually //anchored// at a specific point in time.
:it can be seen as a //special kind of duration,// which explicitly states the information //when// this time span takes place.
;internal time
:While the basic continuous time values don't imply any provision regarding the time scale and origin to be used, actually, within the implementation of the application, the meaning of time values is uniform and free of contradictions. Thus effectively there is an ''implementation time scale'' -- but its scope of validity is //strictly limited to the implementation level of a single application instance.// It is never exposed and never persisted. It might not be reproducible over multiple instantiations of the application. The implementation reserves the right to recalibrate this internal scale. Later, when Lumiera gains the capability to run within a network of render nodes, these instance connections will include a negotiation about the internal time scale, which remains completely opaque to the outer world. This explains, why {{{lumiera::Time}}} instances lack the ability to show their time value beyond debugging purposes. This is to avoid confusion and to stress their opaque nature.
;wall clock and system time
:The core property of any external real world time is that it is //running// -- we have to synchronise to an external time source.
:This implies the presence of a //running synchronisation process,// with the authority to adjust the time base;
:contrast this to the internal time, which is static and unconnected --
;quantised time
:The ''act of quantisation'' transforms a continuous property into a ''discrete'' structure. Prominent examples can be found in the domain of micro physics and with digital information processing. In a broader sense, any measurement or //quantification// also encompasses a quantisation. Regarding time and time measurement, quantisation means alignment to a predefined ''time grid''. Quantisation necessarily is an //irreversible process// -- possible additional informations get discarded.
:Note that quantisation introduces an ''time origin'' and a ''reference scale''
;frame count
:within the context of film and media editing, the specification of a ''frame number'' is an especially important instance of quantisation.
:all the properties of quantisation apply indeed to this special case: it is a time measurement or specification, where the values are aligned to a grid, and there is a reference time point where the counting starts (origin) and a reference scale (frames per second). Handling of quantised time values in Lumiera is defined such as to ensure the presence of all those bits of information. Without such precautions, operating with bare frame numbers leads itself to all kinds of confusions, mismatches, quantisation errors and unnecessary limitations of functionality.
;timecode
:Quantisation also is the foundation of all kinds of formalised time specifications
:actually even a frame count is some kind of (informal) timecode -- other timecodes employ a standardised format.
://every// presentation of time values and every persistent storage and exchange of such values is based on time codes.
:but quantisation and time code aren't identical: a given quantised time value typically can be cast into multiple timecode formats.
!Patterns for handling quantised time
When it comes to actually handling quantised time values, several patterns are conceivable for dealing with the quantisation operation and representing quantised data. As guideline for judging these patterns, the general properties of time quantisation, as detailed above, should be taken into account. Quantising a time value means both //discarding information,// while at the same time //adding information// pertaining the assumptions of the context.
__casual handling__: this is rather an frequently encountered ''anti pattern''. When reading such code, most striking is the sense of general unawareness of the problem, which is then &quot;discovered&quot; on a per case base, which leads to numerous repetitions of the same basic undertakings, but done with individual treatment of each instance (not so much copy-n-paste). Typical code smells:
* the rounding, modulo and subtract-base operations pertinent with scale handling are seemingly inserted as bugfix
* local code path forks to circumvent or compensate for otherwise hard wired calculations based on specific ways to invoke a function
* playing strikingly clever tricks or employing heuristics to &quot;figure out&quot; the missing scale information from accessible context after the fact
* advertising support for some of the conceivable cases as special feature, or adding it as plugin or extension module with limited scope
* linking parts of the necessary additional information to completely unrelated other structures, thus causing code tangling and scattering
* result or behaviour of calculations depends on the way things are set up in a seemingly contingent way, forcing users to stick to very specific procedures and ordered steps.
[&gt;img[Time and Time Quantisation in Lumiera|uml/fig142725.png]]
__static typing__: an analysis of the cases to be expected establishes common patterns and some base cases, which are then represented by distinct types with well established conversions. This can be combined with generic programming for the common parts. Close to the data input, a factory establishes these statically typed values.
__tagged values__: quantised values are explicitly created out of continuous values by a quantiser entity. These quantised data values contain a copy of the original data, adjusted to be exactly aligned with respect to the underlying time grid. In addition, they carry a tag or ID to denote the respective scale, grid or timecode system. This tag can be used later on to assess compatibility or to recast values into another timecode system.
__delayed quantisation__: with this approach, the information loss is delayed as long as possible. Quantised time values are rather treated as promise for quantisation, while the actual time data remains unaltered. Additionally, they carry a tag, or even a direct link to the responsible quantiser instance. Effectively, these are specialised time values, instances of a sub-concept, able to stand-in for general time values, but exposing additional accessors to get a quantised value.
!!!discussion
For Lumiera, the static typing approach is of limited value -- it excels when values belonging to different scales are actually treated differently. There are such cases, but rather on the data handling level, e.g. sound samples are always handled block wise. But regarding time values, the unifying aspect is more important, which leads to prefering a dynamic (run time typed) approach, while //erasing// the special differences most of the time. Yet the dynamic and open nature of the Lumiera high-level model favours the delayed quantisation pattern; the same values may require different quantisation depending on the larger model context an object is encountered in. This solution might be to general and heavy weight at times though. Thus, for important special cases, the accessors should return tagged values, preferably even with differing static type. Time codes can be integrated this way, but most notably the ''frame numbers'' used for addressing throughout the backend, can be implemented as such specifically typed tagged values; the tag here denotes the quantiser and thus the underlying grid -- it should be implemented as hash-ID for smooth integration with code written in plain C.
&amp;rarr; more on [[usage situations|TimeUsage]]
</pre>
</div>
<div title="TimeUsage" modifier="Ichthyostega" modified="201012260235" created="201012230204" tags="design discuss" changecount="15">
<pre>the following collection of usage situations helps to shape the details of the time values and time quantisation design. &amp;rarr; see also [[time quantisation|TimeQuant]]
;time position of an object
:indeed the term &quot;time position&quot; encompasses two quite different questions
:* a time or timing specification within the object
:* determining the time point in reference to an existing scale
;time and length of an object
:basically the same situation, but length could be treated in two ways for quantisation
:* having a precise specification and then quantise the start and endpoint
:* quantise the start position and then establish an (independently quantised length)
;moving and resizing an object
:this can in itself be done in two different ways, and each of them can be applied in a quantised flavour
:which sums up to 8 possible combinations, considering that position and length are 2 degrees of freedom.
:* a variable can be /changed/ by an offset
:* a variable can be /defined/ to a new value
:another (hidden) degree of freedom lies in how to apply an quantised offset to an unquantised value (and reversed)
:because this operation might be done both in the quantised or non-quantised domain, and also the result might be (un)quantised
;updating the playback position
:this can be seen as a practical application of the above; basically we can choose to show the wall clock time or we can advance the playback position in frame increments, thus denoting the frame currently in display. These distinctions may look mood for video, but are relevant for precise audio editing, especially when combined with loop playback (recall that audio is processed block wise, but the individual sample frames and thus the possible loop positions are way finer than the processing block size)
;displaying time intervals
:for display, time intervals get //re-quantised// into display array coordinates.
:While evidently the display coordinates are themselves quantised and we obviously don't want to cancel out the effect of an quantisation of the values or intervals to be displayed (which means, we get two quantisations chained up after each other), there remains the question if the display array coordinates should be aligned to the grid of the //elements to be displayed,// and especially if the allowed zoom factors should be limited. This decision isn't an easy one, as it has an immediate and tangible effect on what can be showed, how reversible and reproducible a view is and (note) on the actual values which can be set and changed through the GUI.
;time value arithmetic
:Client code as well as the internal implementation of time handling needs to do arithmetic operations with time values. Time values are additive and totally ordered. Distance, as calculated by subtraction, can be made into a metric. Another and quite different question is to what extent a quantised variant of this arithmetics is required.
;relative placement
:because of the divergence between quantised and unquantised values, the question arises, if placement relative to another object refers to the raw position or the already quantised position. Basically all the variations discussed for //time and length of an object// also do apply here.
!notable issues
''Direct quantisation of length is not possible''. This is due to the non-linear nature of all but the most trivial time grids: Already such a simple addition like a start offset destroys linearity, and this still the more is true within a compound grid where the grid spacing changes at some point. Thus, the length has to be re-established at the target position of an time interval after each change involving quantisation. Regarding the //strategy// to apply when re-establishing the length, it seems more appropriate to treat the object as an entity which is moved, which means to do quantisation in two steps, first the position, then the endpoint (the second option in the description above). But it seems advisable not to hard wire that strategy -- better put it into the quantiser.
We should note, that the problems regarding quantised durations also carry over to //offsets:// it is difficult to ''define the semantics of a quantised offset''. Seemingly the only viable approach is to have a //intended offset,// and then to apply a re-quantisation to the target after applying the (raw) offset.
''When to materialise a quantisation''. Because of the basic intention to retain information, we delay actually applying the quantisation to the stored values as much as possible. But not materialising immediately at quantisation has the downside of possibly accumulating off-grid values without that being evident. Most notably, if we apply the raw offsets produced by GUI interactions, the object's positions and lengthes are bound to accumulate spurious information never intended by the user.
Thus, an especially important instance of that problem is ''how to deal with updates in a quantised environment''. If we handle quantisation stictly as a view employed on output, we run into the problems with accumulating spurious information. On the other hand, allowing for quantised changes inevitably pulls in all the complexity of mixing quantised and non-quantised values. It would be desirable somehow to move these distinctions out of the scope of this design and offload them onto the client (code using these time classes).
Another closely related problem is ''when to allow mutations'', if at all. We can't completely do away with mutations, simply because we don't have a pure functional language at our disposal. The whole concept of //reference semantics// doesn't play so well with immutable objects. The Lumiera high-level (session) model certainly relies on objects intended to be //manipulated.// Thus we need a re-settable length field in {{{MObject}}} and we need a time variable for position calculations. Yet we could make any //derived objects// into immutable descriptor records, which certainly helps with parallelism.
The ''problem with playback position'' is -- that it's an attempt to conceptualise a non-existing entity. There is no such thing like &quot;the&quot; playback position. Yet most applications I'm aware off employ this concept. Likely they got trapped by the metaphor of the tape head, again. We should do away with that. On playback, we should show a //projection of wall-clock time onto the expected playback range// -- not more, not less. It should be acknowledged that there is //no direct link to the ongoing playback processes,// besides the fact that they're assumed to sync to wall-clock time as well. Recall, typically there are multiple playback processes going on in compound, and each might run on a different update rate. If we really want a //visual out-of-sync indicator,// we should treat that as a separate reporting facility and display it apart of the playback cursor.
Note that the ''display window might be treated as just an independent instance of quantisation''. This is similar to the approach taken above for modifying quantised time span values. We should provide a special kind of time grid, the display coordinates. The origin of these is always defined to the left (lower) side of the interval to be displayed, and they are gauged in screen units (pixels or similar, as used by the GUI toolkit set). The rest is handled by the general quantisation mechanisms. The problem of aligning the display should be transformed into a general facility to align grids, and solved for the general case. Doing so solves the remaining problems with quantised value changes and with ''specifying relative placements'' as well: If we choose to represent them as quantised values, we might (or might not) also choose to apply this //grid-alignment function.//
!substantial problems to be solved
* how to align multiple grids
* how to integrate modifications of quantised values.
The problem with modification of quantised values highlights an inner contratiction or conflicting goals
* the whole system should fit in naturally and just feel like using raw time values
* quantisation should be added //late// -- like a view
* there should be a guidance towards the intended proper use
!!! possible solutions{{red{WIP 12/10}}}
* only allow to assign a completely new setting
* only accept raw time values for redefining a quantised interval
* only accept an abstract //modification object.//
!!!usage considerations
Question is: how fine grained and configurable needs this to be?
* for example, when moving a clip taken from 50fps media, the new position might be quantised to the 50fps grid established by the media, while the target timeline runs with 25fps, allowing for finer adjustments based on the intermediate frames present in the source material.
* likely we need a &quot;nudge by unit(s)&quot;
</pre>
</div>
<div title="Timeline" modifier="Ichthyostega" modified="201011220126" created="200706250721" tags="def" changecount="21">