From e9a8b9f64d2b3ccf4887e8b75a19d1e291c249c7 Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Tue, 8 Apr 2008 23:01:32 +0100 Subject: [PATCH 001/110] Revert "Lumiera renaming -- source code" This reverts commit e737b9ef1ba938ca2cdd7372fb18c0cac0dd74b9. --- src/backend/mediaaccessfacade.cpp | 4 +- src/backend/mediaaccessfacade.hpp | 2 +- src/{lumiera.h => cinelerra.h} | 12 +- src/common/appconfig.cpp | 10 +- src/common/appconfig.hpp | 8 +- src/common/error.cpp | 38 ++-- src/common/error.hpp | 84 ++++----- src/common/factory.hpp | 8 +- src/common/multithread.hpp | 12 +- src/common/singleton.hpp | 6 +- src/common/singletonfactory.hpp | 8 +- src/common/singletonpolicies.hpp | 14 +- src/common/singletonpreconfigure.hpp | 18 +- src/common/test/mockinjector.hpp | 8 +- src/common/test/suite.cpp | 6 +- src/common/time.cpp | 4 +- src/common/time.hpp | 8 +- src/common/typelist.hpp | 10 +- src/common/visitor.cpp | 4 +- src/common/visitor.hpp | 10 +- src/common/visitordispatcher.hpp | 8 +- src/common/visitorpolicies.hpp | 12 +- src/lib/condition.c | 12 +- src/lib/condition.h | 86 ++++----- src/lib/error.c | 32 ++-- src/lib/error.h | 38 ++-- src/lib/framerate.c | 4 +- src/lib/framerate.h | 42 ++--- src/lib/locking.h | 14 +- src/lib/mutex.c | 10 +- src/lib/mutex.h | 90 +++++----- src/lib/plugin.c | 164 +++++++++--------- src/lib/plugin.h | 74 ++++---- src/lib/references.c | 70 ++++---- src/lib/references.h | 52 +++--- src/lib/rwlock.c | 62 +++---- src/lib/rwlock.h | 60 +++---- src/lib/time.c | 6 +- src/lib/time.h | 66 +++---- src/main.cpp | 4 +- src/nobugcfg.h | 2 +- src/plugin/helloplugin.c | 4 +- src/pre.hpp | 8 +- src/proc/asset.cpp | 2 +- src/proc/asset.hpp | 4 +- src/proc/asset/db.hpp | 4 +- src/proc/asset/media.cpp | 22 +-- src/proc/asset/media.hpp | 8 +- src/proc/asset/meta.hpp | 2 +- src/proc/asset/proc.hpp | 2 +- src/proc/asset/struct.hpp | 2 +- src/proc/asset/unknown.cpp | 16 +- src/proc/asset/unknown.hpp | 6 +- src/proc/assetmanager.cpp | 30 ++-- src/proc/assetmanager.hpp | 12 +- src/proc/engine/codecadapter.hpp | 2 +- src/proc/engine/pluginadapter.hpp | 2 +- src/proc/engine/processor.hpp | 6 +- src/proc/mobject/builder/buildertool.hpp | 8 +- src/proc/mobject/mobject.hpp | 6 +- src/proc/mobject/placement.hpp | 2 +- src/proc/mobject/session.hpp | 2 +- src/proc/mobject/session/locatingpin.hpp | 4 +- src/proc/mobject/session/segment.hpp | 4 +- src/proc/mobject/session/session.cpp | 2 +- src/proc/mobject/session/sessionimpl.cpp | 2 +- src/proc/mobject/session/sessionimpl.hpp | 2 +- src/tool/hello.c | 4 +- tests/10errorhandling.tests | 4 +- tests/50components.tests | 20 +-- tests/54builder.tests | 2 +- tests/components/backend/mediaaccessmock.cpp | 2 +- tests/components/backend/mediaaccessmock.hpp | 2 +- tests/components/common/appconfigtest.cpp | 6 +- .../components/common/exceptionerrortest.cpp | 38 ++-- .../components/common/factoryspecialtest.cpp | 4 +- tests/components/common/factorytest.cpp | 6 +- tests/components/common/singletontest.cpp | 10 +- .../common/singletontestmocktest.cpp | 8 +- tests/components/common/testtargetobj.hpp | 8 +- tests/components/common/typelisttest.cpp | 4 +- .../components/common/visitingtoolconcept.cpp | 8 +- .../common/visitingtoolextendedtest.cpp | 4 +- tests/components/common/visitingtooltest.cpp | 4 +- tests/components/helloworldtest.cpp | 4 +- tests/components/mainsuite.cpp | 2 +- .../components/proc/asset/createassettest.cpp | 18 +- .../proc/asset/mediastructurequerytest.cpp | 2 +- .../mobject/controller/rendersegmenttest.cpp | 2 +- .../proc/mobject/placementbasictest.cpp | 2 +- .../proc/mobject/session/addcliptest.cpp | 2 +- .../proc/mobject/session/testclip.cpp | 4 +- tests/error/errortest.c | 16 +- tests/library/test-llist.c | 2 +- tests/library/test-references.c | 10 +- tests/locking/condition.c | 8 +- tests/locking/mutex.c | 8 +- tests/locking/test-condition.c | 10 +- tests/locking/test-locking.c | 2 +- tests/plugin/example_plugin.c | 16 +- tests/plugin/example_plugin.cpp | 16 +- tests/plugin/hello_interface.h | 8 +- tests/plugin/plugin_main.c | 34 ++-- tests/time/test-time.c | 86 ++++----- 104 files changed, 866 insertions(+), 866 deletions(-) rename src/{lumiera.h => cinelerra.h} (90%) diff --git a/src/backend/mediaaccessfacade.cpp b/src/backend/mediaaccessfacade.cpp index ad52698b8..bd12068f9 100644 --- a/src/backend/mediaaccessfacade.cpp +++ b/src/backend/mediaaccessfacade.cpp @@ -26,13 +26,13 @@ #include "common/util.hpp" using util::isnil; -using lumiera::error::Invalid; +using cinelerra::error::Invalid; namespace backend_interface { /** storage for the SingletonFactory - * (actually a lumiera::test::MockInjector) */ + * (actually a cinelerra::test::MockInjector) */ Singleton MediaAccessFacade::instance; diff --git a/src/backend/mediaaccessfacade.hpp b/src/backend/mediaaccessfacade.hpp index 63741b02e..15579d491 100644 --- a/src/backend/mediaaccessfacade.hpp +++ b/src/backend/mediaaccessfacade.hpp @@ -59,7 +59,7 @@ namespace backend_interface * information from this file, NULL if the * file is not acessible. */ - virtual FileHandle queryFile (const char* name) throw(lumiera::error::Invalid); + virtual FileHandle queryFile (const char* name) throw(cinelerra::error::Invalid); /** request for information about the n-th channel * of the file refered by FileHandle. diff --git a/src/lumiera.h b/src/cinelerra.h similarity index 90% rename from src/lumiera.h rename to src/cinelerra.h index 12b1578b9..30264a904 100644 --- a/src/lumiera.h +++ b/src/cinelerra.h @@ -1,5 +1,5 @@ /* - LUMIERA.h - global definitions and common types + CINELERRA.h - global definitions and common types Copyright (C) Lumiera.org @@ -22,8 +22,8 @@ */ -#ifndef LUMIERA_H -#define LUMIERA_H +#ifndef CINELERRA_H +#define CINELERRA_H @@ -54,13 +54,13 @@ extern "C" { #include "common/error.hpp" -namespace lumiera +namespace cinelerra { /* additional global configuration goes here... */ -} // namespace lumiera +} // namespace cinelerra #endif /* ===================== (End) C++-Part ================= */ -#endif /*LUMIERA_H*/ +#endif /*CINELERRA_H*/ diff --git a/src/common/appconfig.cpp b/src/common/appconfig.cpp index 612376022..fdf16cf40 100644 --- a/src/common/appconfig.cpp +++ b/src/common/appconfig.cpp @@ -34,7 +34,7 @@ using util::isnil; -namespace lumiera +namespace cinelerra { /** This internal pointer to the single instance is deliberately @@ -52,7 +52,7 @@ namespace lumiera /** perform initialization on first access. * A call is placed in static initialization code - * included in lumiera.h; thus it will happen + * included in cinelerra.h; thus it will happen * probably very early. */ Appconfig::Appconfig() @@ -65,7 +65,7 @@ namespace lumiera INFO(config, "Basic application configuration triggered."); // install our own handler for undeclared exceptions - std::set_unexpected (lumiera::error::lumiera_unexpectedException); + std::set_unexpected (cinelerra::error::cinelerra_unexpectedException); (*configParam_)["version"] = STRINGIFY (LUMIERA_VERSION); } @@ -89,10 +89,10 @@ namespace lumiera catch (...) { ERROR(config, "error while accessing configuration parameter \"%s\".", key.c_str()); - throw lumiera::error::Fatal (); + throw cinelerra::error::Fatal (); } } -} // namespace lumiera +} // namespace cinelerra diff --git a/src/common/appconfig.hpp b/src/common/appconfig.hpp index 984236755..bbd50df6f 100644 --- a/src/common/appconfig.hpp +++ b/src/common/appconfig.hpp @@ -34,8 +34,8 @@ */ -#ifndef LUMIERA_APPCONFIG_H -#define LUMIERA_APPCONFIG_H +#ifndef CINELERRA_APPCONFIG_H +#define CINELERRA_APPCONFIG_H #include #include @@ -45,7 +45,7 @@ -namespace lumiera +namespace cinelerra { using std::string; using boost::scoped_ptr; @@ -104,5 +104,5 @@ namespace lumiera -} // namespace lumiera +} // namespace cinelerra #endif diff --git a/src/common/error.cpp b/src/common/error.cpp index e708c5d3a..17e18e676 100644 --- a/src/common/error.cpp +++ b/src/common/error.cpp @@ -1,5 +1,5 @@ /* - Error - Lumiera Exception Interface + Error - Cinelerra Exception Interface Copyright (C) Lumiera.org 2008, Hermann Vosseler @@ -33,7 +33,7 @@ using util::isnil; using std::exception; -namespace lumiera +namespace cinelerra { namespace error @@ -46,23 +46,23 @@ namespace lumiera */ inline const string default_usermsg (Error* exception_obj) throw() { - return string("Sorry, Lumiera encountered an internal error. (") + return string("Sorry, Cinelerra encountered an internal error. (") + typeid(*exception_obj).name() + ")"; } /* constants to be used as error IDs */ - LUMIERA_ERROR_DEFINE (LOGIC , "internal logic broken"); - LUMIERA_ERROR_DEFINE (FATAL , "floundered"); - LUMIERA_ERROR_DEFINE (CONFIG , "misconfiguration"); - LUMIERA_ERROR_DEFINE (STATE , "unforseen state"); - LUMIERA_ERROR_DEFINE (INVALID , "invalid input or parameters"); - LUMIERA_ERROR_DEFINE (EXTERNAL , "failure in external service"); - LUMIERA_ERROR_DEFINE (ASSERTION, "assertion failure"); + CINELERRA_ERROR_DEFINE (LOGIC , "internal logic broken"); + CINELERRA_ERROR_DEFINE (FATAL , "floundered"); + CINELERRA_ERROR_DEFINE (CONFIG , "misconfiguration"); + CINELERRA_ERROR_DEFINE (STATE , "unforseen state"); + CINELERRA_ERROR_DEFINE (INVALID , "invalid input or parameters"); + CINELERRA_ERROR_DEFINE (EXTERNAL , "failure in external service"); + CINELERRA_ERROR_DEFINE (ASSERTION, "assertion failure"); } // namespace error - LUMIERA_ERROR_DEFINE (EXCEPTION, "generic Lumiera exception"); + CINELERRA_ERROR_DEFINE (EXCEPTION, "generic cinelerra exception"); @@ -75,7 +75,7 @@ namespace lumiera desc_ (description), cause_ ("") { - lumiera_error_set (this->id_); + cinelerra_error_set (this->id_); } @@ -87,7 +87,7 @@ namespace lumiera desc_ (description), cause_ (extractCauseMsg(cause)) { - lumiera_error_set (this->id_); + cinelerra_error_set (this->id_); } @@ -103,7 +103,7 @@ namespace lumiera /** Description of the problem, including the internal char constant - * in accordance to Lumiera's error identification scheme. + * in accordance to cinelerra's error identification scheme. * If a root cause can be obtained, this will be included in the * generated output as well. */ @@ -167,15 +167,15 @@ namespace lumiera namespace error { - void lumiera_unexpectedException () throw() + void cinelerra_unexpectedException () throw() { const char* is_halted - = "### Lumiera halted due to an unexpected Error ###"; + = "### Cinelerra halted due to an unexpected Error ###"; std::cerr << "\n" << is_halted << "\n\n"; ERROR (NOBUG_ON, "%s", is_halted); - if (const char * errorstate = lumiera_error ()) + if (const char * errorstate = cinelerra_error ()) ERROR (NOBUG_ON, "last registered error was....\n%s", errorstate); std::terminate(); @@ -183,7 +183,7 @@ namespace lumiera void assertion_terminate (const string& location) { - throw Fatal (location, LUMIERA_ERROR_ASSERTION) + throw Fatal (location, CINELERRA_ERROR_ASSERTION) .setUsermsg("Program terminated because of violating " "an internal consistency check."); } @@ -191,4 +191,4 @@ namespace lumiera } // namespace error -} // namespace lumiera +} // namespace cinelerra diff --git a/src/common/error.hpp b/src/common/error.hpp index 4ccb8b1d7..15e60f022 100644 --- a/src/common/error.hpp +++ b/src/common/error.hpp @@ -1,5 +1,5 @@ /* - ERROR.hpp - Lumiera Exception Interface + ERROR.hpp - Cinelerra Exception Interface Copyright (C) Lumiera.org 2008, Hermann Vosseler @@ -21,26 +21,26 @@ */ -#ifndef LUMIERA_ERROR_HPP_ -#define LUMIERA_ERROR_HPP_ +#ifndef CINELERRA_ERROR_HPP_ +#define CINELERRA_ERROR_HPP_ #include #include "nobugcfg.h" #include "lib/error.h" -namespace lumiera +namespace cinelerra { using std::string; /** error-ID for unspecified exceptions */ - LUMIERA_ERROR_DECLARE(EXCEPTION); + CINELERRA_ERROR_DECLARE(EXCEPTION); /** * Interface and Baseclass of all Exceptions thrown - * from within Lumiera (C++) code. Common operations + * from within cinelerra (C++) code. Common operations * for getting an diagnostic message and for obtaining * the root cause, i.e. the first exception encountered * in a chain of exceptions. @@ -48,9 +48,9 @@ namespace lumiera class Error : public std::exception { public: - Error (string description="", const char* id=LUMIERA_ERROR_EXCEPTION) throw(); + Error (string description="", const char* id=CINELERRA_ERROR_EXCEPTION) throw(); Error (std::exception& cause, - string description="", const char* id=LUMIERA_ERROR_EXCEPTION) throw(); + string description="", const char* id=CINELERRA_ERROR_EXCEPTION) throw(); Error (const Error&) throw(); virtual ~Error () throw() {}; @@ -58,7 +58,7 @@ namespace lumiera /** yield a diagnostic message characterizing the problem */ virtual const char* what () const throw(); - /** the internal Lumiera-error-ID (was set as C-errorstate in ctor) */ + /** the internal cinelerra-error-ID (was set as C-errorstate in ctor) */ const char* getID () const throw() { return this->id_; } /** extract the message to be displayed for the user */ @@ -80,7 +80,7 @@ namespace lumiera private: - const char* id_; ///< an LUMIERA_ERROR id, which is set as errorstate on construction + const char* id_; ///< an CINELERRA_ERROR id, which is set as errorstate on construction string msg_; ///< friendly message intended for users (to be localized) string desc_; ///< detailed description of the error situation for the developers mutable string what_; ///< buffer for generating the detailed description on demand @@ -105,68 +105,68 @@ namespace lumiera * can be considered a severe design flaw; we can just * add some diagnostics prior to halting. */ - void lumiera_unexpectedException () throw(); + void cinelerra_unexpectedException () throw(); /** throw an error::Fatal indicating "assertion failure" */ void assertion_terminate (const string& location); /* constants to be used as error IDs */ - LUMIERA_ERROR_DECLARE (LOGIC ); ///< contradiction to internal logic assumptions detected - LUMIERA_ERROR_DECLARE (FATAL ); ///< unable to cope with, internal logic floundered - LUMIERA_ERROR_DECLARE (CONFIG ); ///< execution aborted due to misconfiguration - LUMIERA_ERROR_DECLARE (STATE ); ///< unforeseen internal state - LUMIERA_ERROR_DECLARE (INVALID ); ///< invalid input or parameters encountered - LUMIERA_ERROR_DECLARE (EXTERNAL ); ///< failure in external service the application relies on - LUMIERA_ERROR_DECLARE (ASSERTION); ///< assertion failure + CINELERRA_ERROR_DECLARE (LOGIC ); ///< contradiction to internal logic assumptions detected + CINELERRA_ERROR_DECLARE (FATAL ); ///< unable to cope with, internal logic floundered + CINELERRA_ERROR_DECLARE (CONFIG ); ///< execution aborted due to misconfiguration + CINELERRA_ERROR_DECLARE (STATE ); ///< unforeseen internal state + CINELERRA_ERROR_DECLARE (INVALID ); ///< invalid input or parameters encountered + CINELERRA_ERROR_DECLARE (EXTERNAL ); ///< failure in external service the application relies on + CINELERRA_ERROR_DECLARE (ASSERTION); ///< assertion failure /** Macro for creating derived exception classes properly - * integrated into Lumiera's exception hierarchy. Using + * integrated into cinelerra's exception hierarchy. Using * this macro asures that the new class will get the full * set of constructors and behaviour common to all exception * classes, so it should be used when creating an derived * exception type for more then stricly local purposes */ -#define LUMIERA_EXCEPTION_DECLARE(CLASS, PARENT, _ID_) \ - class CLASS : public PARENT \ - { \ - public: \ - CLASS (std::string description="", \ - const char* id=_ID_) throw() \ - : PARENT (description, id) {} \ - \ - CLASS (std::exception& cause, \ - std::string description="", \ - const char* id=_ID_) throw() \ - : PARENT (cause, description, id) {} \ +#define CINELERRA_EXCEPTION_DECLARE(CLASS, PARENT, _ID_) \ + class CLASS : public PARENT \ + { \ + public: \ + CLASS (std::string description="", \ + const char* id=_ID_) throw() \ + : PARENT (description, id) {} \ + \ + CLASS (std::exception& cause, \ + std::string description="", \ + const char* id=_ID_) throw() \ + : PARENT (cause, description, id) {} \ }; - //-------------------------CLASS-----PARENT--ID---------------------- - LUMIERA_EXCEPTION_DECLARE (Logic, Error, LUMIERA_ERROR_LOGIC); - LUMIERA_EXCEPTION_DECLARE (Fatal, Logic, LUMIERA_ERROR_FATAL); - LUMIERA_EXCEPTION_DECLARE (Config, Error, LUMIERA_ERROR_CONFIG); - LUMIERA_EXCEPTION_DECLARE (State, Error, LUMIERA_ERROR_STATE); - LUMIERA_EXCEPTION_DECLARE (Invalid, Error, LUMIERA_ERROR_INVALID); - LUMIERA_EXCEPTION_DECLARE (External, Error, LUMIERA_ERROR_EXTERNAL); + //---------------------------CLASS-----PARENT--ID---------------------- + CINELERRA_EXCEPTION_DECLARE (Logic, Error, CINELERRA_ERROR_LOGIC); + CINELERRA_EXCEPTION_DECLARE (Fatal, Logic, CINELERRA_ERROR_FATAL); + CINELERRA_EXCEPTION_DECLARE (Config, Error, CINELERRA_ERROR_CONFIG); + CINELERRA_EXCEPTION_DECLARE (State, Error, CINELERRA_ERROR_STATE); + CINELERRA_EXCEPTION_DECLARE (Invalid, Error, CINELERRA_ERROR_INVALID); + CINELERRA_EXCEPTION_DECLARE (External, Error, CINELERRA_ERROR_EXTERNAL); } // namespace error -} // namespace lumiera +} // namespace cinelerra /****************************************************** * if NoBug is used, redefine some macros - * to rather throw Lumiera Errors instead of aborting + * to rather throw Cinelerra Errors instead of aborting */ #ifdef NOBUG_ABORT #undef NOBUG_ABORT #define CIN_NOBUG_LOCATION \ std::string (NOBUG_BASENAME(__FILE__)) +":"+ NOBUG_STRINGIZE(__LINE__) + ", function " + __func__ #define NOBUG_ABORT \ - lumiera::error::assertion_terminate (CIN_NOBUG_LOCATION); + cinelerra::error::assertion_terminate (CIN_NOBUG_LOCATION); #endif -#endif // LUMIERA_ERROR_HPP_ +#endif // CINELERRA_ERROR_HPP_ diff --git a/src/common/factory.hpp b/src/common/factory.hpp index 5645cfba6..a4b953b3a 100644 --- a/src/common/factory.hpp +++ b/src/common/factory.hpp @@ -21,14 +21,14 @@ */ -#ifndef LUMIERA_FACTORY_H -#define LUMIERA_FACTORY_H +#ifndef CINELERRA_FACTORY_H +#define CINELERRA_FACTORY_H #include -namespace lumiera +namespace cinelerra { namespace factory { @@ -141,5 +141,5 @@ namespace lumiera using factory::Factory; -} // namespace lumiera +} // namespace cinelerra #endif diff --git a/src/common/multithread.hpp b/src/common/multithread.hpp index 1dbbac519..cc6eca1c6 100644 --- a/src/common/multithread.hpp +++ b/src/common/multithread.hpp @@ -23,21 +23,21 @@ -#ifndef LUMIERA_MULTITHREAD_H -#define LUMIERA_MULTITHREAD_H +#ifndef CINELERRA_MULTITHREAD_H +#define CINELERRA_MULTITHREAD_H #include "nobugcfg.h" -namespace lumiera +namespace cinelerra { /** * Interface/Policy for managing parallelism issues. * Basically everything is forwarded to the corresponding backend functions, - * because managing threads and locking belongs to the Lumiera backend layer. + * because managing threads and locking belongs to the cinelerra backend layer. * - * @todo actually implement this policy using the Lumiera databackend. + * @todo actually implement this policy using the cinelerra databackend. */ struct Thread { @@ -52,5 +52,5 @@ namespace lumiera }; -} // namespace lumiera +} // namespace cinelerra #endif diff --git a/src/common/singleton.hpp b/src/common/singleton.hpp index c5de1474d..9f149214f 100644 --- a/src/common/singleton.hpp +++ b/src/common/singleton.hpp @@ -30,7 +30,7 @@ ** e.g. sometimes we want to include a hook for injecting Test Mock instances. ** ** You'll find the default Policies in singletonfactory.hpp and the default - ** definition of type lumiera::singleton in singletonpreconfigure.hpp + ** definition of type cinelerra::singleton in singletonpreconfigure.hpp ** ** @see SingletonFactory ** @see singleton::StaticCreate @@ -40,8 +40,8 @@ */ -#ifndef LUMIERA_SINGLETON_H -#define LUMIERA_SINGLETON_H +#ifndef CINELERRA_SINGLETON_H +#define CINELERRA_SINGLETON_H #include "common/singletonpolicies.hpp" diff --git a/src/common/singletonfactory.hpp b/src/common/singletonfactory.hpp index 026b6990e..319722fcf 100644 --- a/src/common/singletonfactory.hpp +++ b/src/common/singletonfactory.hpp @@ -31,8 +31,8 @@ This code is heavily inspired by -#ifndef LUMIERA_SINGLETONFACTORY_H -#define LUMIERA_SINGLETONFACTORY_H +#ifndef CINELERRA_SINGLETONFACTORY_H +#define CINELERRA_SINGLETONFACTORY_H #include "common/singletonpolicies.hpp" ///< several Policies usable together with SingletonFactory @@ -43,7 +43,7 @@ This code is heavily inspired by //#include -namespace lumiera +namespace cinelerra { /** @@ -136,5 +136,5 @@ namespace lumiera ///// It seems this would either cost us much of the flexibility or get complicated ///// to a point where we could as well implement our own Depenency Injection Manager. -} // namespace lumiera +} // namespace cinelerra #endif diff --git a/src/common/singletonpolicies.hpp b/src/common/singletonpolicies.hpp index f0b448305..5ae31b939 100644 --- a/src/common/singletonpolicies.hpp +++ b/src/common/singletonpolicies.hpp @@ -31,8 +31,8 @@ This code is heavily inspired by -#ifndef LUMIERA_SINGLETONPOLICIES_H -#define LUMIERA_SINGLETONPOLICIES_H +#ifndef CINELERRA_SINGLETONPOLICIES_H +#define CINELERRA_SINGLETONPOLICIES_H #include "common/multithread.hpp" #include "common/error.hpp" @@ -40,11 +40,11 @@ This code is heavily inspired by #include -namespace lumiera +namespace cinelerra { namespace singleton { - /* === several Policies usable in conjunction with lumiera::Singleton === */ + /* == several Policies usable in conjunction with cinelerra::Singleton == */ /** * Policy placing the Singleton instance into a statically allocated buffer @@ -133,13 +133,13 @@ namespace lumiera /** * Policy for handling multithreaded access to the singleton instance - * @todo actually implement this policy using the Lumiera databackend. + * @todo actually implement this policy using the cinelerra databackend. */ template struct Multithreaded { typedef volatile S VolatileType; - typedef lumiera::Thread::Lock Lock; + typedef cinelerra::Thread::Lock Lock; }; @@ -156,5 +156,5 @@ namespace lumiera } // namespace singleton -} // namespace lumiera +} // namespace cinelerra #endif diff --git a/src/common/singletonpreconfigure.hpp b/src/common/singletonpreconfigure.hpp index e9b12e3d6..9f3cfb8b2 100644 --- a/src/common/singletonpreconfigure.hpp +++ b/src/common/singletonpreconfigure.hpp @@ -31,7 +31,7 @@ ** One reason why one wants special Singleton behaviour is testing: Without ** altering the executable, for running some tests we need to inject a Test Mock ** in place of some service object, so we can verify the behaviour of the code - ** using this service. For this, we mix lumiera::test::MockInjector + ** using this service. For this, we mix cinelerra::test::MockInjector ** into the actual Singleton type. ** ** @note we declare the specialisations into the target namespace @@ -41,13 +41,13 @@ */ -#ifndef LUMIERA_SINGLETONPRECONFIGURE_H -#define LUMIERA_SINGLETONPRECONFIGURE_H +#ifndef CINELERRA_SINGLETONPRECONFIGURE_H +#define CINELERRA_SINGLETONPRECONFIGURE_H #include "common/test/mockinjector.hpp" -namespace lumiera +namespace cinelerra { /** * Default Singleton configuration @@ -67,15 +67,15 @@ namespace lumiera namespace test { class TestSingletonO; - using lumiera::Singleton; + using cinelerra::Singleton; } // namespace test -} // namespace lumiera +} // namespace cinelerra namespace backend_interface { class MediaAccessFacade; - using lumiera::Singleton; + using cinelerra::Singleton; } // namespace backend_interface @@ -87,7 +87,7 @@ namespace backend_interface /* Specialisation Definitions */ /* ************************** */ -namespace lumiera +namespace cinelerra { using test::MockInjector; @@ -104,7 +104,7 @@ namespace lumiera : public MockInjector { }; -} // namespace lumiera +} // namespace cinelerra diff --git a/src/common/test/mockinjector.hpp b/src/common/test/mockinjector.hpp index 4daf78081..28258e91e 100644 --- a/src/common/test/mockinjector.hpp +++ b/src/common/test/mockinjector.hpp @@ -22,8 +22,8 @@ -#ifndef LUMIERA_TEST_MOCKINJECTOR_H -#define LUMIERA_TEST_MOCKINJECTOR_H +#ifndef CINELERRA_TEST_MOCKINJECTOR_H +#define CINELERRA_TEST_MOCKINJECTOR_H #include "common/singletonfactory.hpp" @@ -31,7 +31,7 @@ #include -namespace lumiera +namespace cinelerra { namespace test { @@ -90,5 +90,5 @@ namespace lumiera } // namespace test -} // namespace lumiera +} // namespace cinelerra #endif diff --git a/src/common/test/suite.cpp b/src/common/test/suite.cpp index 897a7d04f..c81c88097 100644 --- a/src/common/test/suite.cpp +++ b/src/common/test/suite.cpp @@ -133,7 +133,7 @@ namespace test TRACE(test, "Test-Suite( groupID=%s )\n", groupID.c_str () ); if (!testcases.getGroup(groupID)) - throw lumiera::error::Invalid (); + throw cinelerra::error::Invalid (); //throw "empty testsuite"; /////////// TODO Errorhandling! } @@ -155,7 +155,7 @@ namespace test { PTestMap tests = testcases.getGroup(groupID_); if (!tests) - throw lumiera::error::Invalid (); ///////// TODO: pass error description + throw cinelerra::error::Invalid (); ///////// TODO: pass error description if (0 < cmdline.size()) { @@ -209,7 +209,7 @@ namespace test } catch (...) { - std::cout << "PLANNED ============= " << lumiera_error() << "\n"; + std::cout << "PLANNED ============= " << cinelerra_error() << "\n"; } std::cout << "END\n"; } diff --git a/src/common/time.cpp b/src/common/time.cpp index a37979c6b..c208fcb46 100644 --- a/src/common/time.cpp +++ b/src/common/time.cpp @@ -25,7 +25,7 @@ #include -namespace lumiera +namespace cinelerra { // TODO: dummy values; should be adjusted when switching to the real time implementation provided by the backend @@ -34,4 +34,4 @@ namespace lumiera const Time Time::MIN = -std::numeric_limits::max(); -} // namespace lumiera +} // namespace cinelerra diff --git a/src/common/time.hpp b/src/common/time.hpp index d065c3f36..c4fc22244 100644 --- a/src/common/time.hpp +++ b/src/common/time.hpp @@ -21,13 +21,13 @@ */ -#ifndef LUMIERA_TIME_H -#define LUMIERA_TIME_H +#ifndef CINELERRA_TIME_H +#define CINELERRA_TIME_H #include -namespace lumiera +namespace cinelerra { @@ -56,5 +56,5 @@ namespace lumiera -} // namespace lumiera +} // namespace cinelerra #endif diff --git a/src/common/typelist.hpp b/src/common/typelist.hpp index f358a605e..6d2720fcb 100644 --- a/src/common/typelist.hpp +++ b/src/common/typelist.hpp @@ -47,19 +47,19 @@ This code is heavily inspired by ** ** Interface for using this facility is the template Types(.....) for up to 20 Type parameters ** - ** @see lumiera::visitor::Applicable usage example + ** @see cinelerra::visitor::Applicable usage example ** @see typelisttest.cpp ** */ -#ifndef LUMIERA_TYPELIST_H -#define LUMIERA_TYPELIST_H +#ifndef CINELERRA_TYPELIST_H +#define CINELERRA_TYPELIST_H -namespace lumiera +namespace cinelerra { namespace typelist { @@ -116,5 +116,5 @@ namespace lumiera } // namespace typelist -} // namespace lumiera +} // namespace cinelerra #endif diff --git a/src/common/visitor.cpp b/src/common/visitor.cpp index 91b195623..f702f809b 100644 --- a/src/common/visitor.cpp +++ b/src/common/visitor.cpp @@ -23,7 +23,7 @@ #include "common/visitor.hpp" -namespace lumiera +namespace cinelerra { namespace visitor { @@ -32,4 +32,4 @@ namespace lumiera } // namespace visitor -} // namespace lumiera +} // namespace cinelerra diff --git a/src/common/visitor.hpp b/src/common/visitor.hpp index 837ddf713..251254a88 100644 --- a/src/common/visitor.hpp +++ b/src/common/visitor.hpp @@ -37,7 +37,7 @@ Credits for many further implementation ideas go to /** @file visitor.hpp ** A library implementation of the Visitor Pattern taylored specifically - ** to Lumiera's needs within the Proc Layer. Visitor enables double dispatch + ** to cinelerra's needs within the Proc Layer. Visitor enables double dispatch ** calls, based both on the concrete type of some target object and the concrete type of ** a tool object being applied to this target. The code carrying out this tool application ** (and thus triggering the double dispatch) need not know any of these concret types and is @@ -73,8 +73,8 @@ Credits for many further implementation ideas go to -#ifndef LUMIERA_VISITOR_H -#define LUMIERA_VISITOR_H +#ifndef CINELERRA_VISITOR_H +#define CINELERRA_VISITOR_H #include "common/visitorpolicies.hpp" #include "common/visitordispatcher.hpp" @@ -82,7 +82,7 @@ Credits for many further implementation ideas go to #include "common/typelist.hpp" -namespace lumiera +namespace cinelerra { namespace visitor { @@ -229,5 +229,5 @@ namespace lumiera } // namespace visitor -} // namespace lumiera +} // namespace cinelerra #endif diff --git a/src/common/visitordispatcher.hpp b/src/common/visitordispatcher.hpp index dcc28391b..0be12b2df 100644 --- a/src/common/visitordispatcher.hpp +++ b/src/common/visitordispatcher.hpp @@ -22,8 +22,8 @@ -#ifndef LUMIERA_VISITORDISPATCHER_H -#define LUMIERA_VISITORDISPATCHER_H +#ifndef CINELERRA_VISITORDISPATCHER_H +#define CINELERRA_VISITORDISPATCHER_H #include "common/error.hpp" #include "common/util.hpp" @@ -33,7 +33,7 @@ #include -namespace lumiera +namespace cinelerra { namespace visitor { @@ -211,5 +211,5 @@ namespace lumiera } // namespace visitor -} // namespace lumiera +} // namespace cinelerra #endif diff --git a/src/common/visitorpolicies.hpp b/src/common/visitorpolicies.hpp index e59a2f5b2..6b9f353a5 100644 --- a/src/common/visitorpolicies.hpp +++ b/src/common/visitorpolicies.hpp @@ -22,20 +22,20 @@ /** @file visitorpolicies.hpp - ** Policies usable for configuring the lumiera::visitor::Tool for different kinds of error handling. + ** Policies usable for configuring the cinelerra::visitor::Tool for different kinds of error handling. ** @see buildertool.hpp for another flavor (calling and catch-all-function) ** */ -#ifndef LUMIERA_VISITORPOLICIES_H -#define LUMIERA_VISITORPOLICIES_H +#ifndef CINELERRA_VISITORPOLICIES_H +#define CINELERRA_VISITORPOLICIES_H #include "common/error.hpp" -namespace lumiera +namespace cinelerra { namespace visitor { @@ -65,7 +65,7 @@ namespace lumiera RET onUnknown (TAR&) { - throw lumiera::error::Config("unable to decide what tool operation to call"); + throw cinelerra::error::Config("unable to decide what tool operation to call"); } }; @@ -73,5 +73,5 @@ namespace lumiera } // namespace visitor -} // namespace lumiera +} // namespace cinelerra #endif diff --git a/src/lib/condition.c b/src/lib/condition.c index 7427b431d..2b0bc28e8 100644 --- a/src/lib/condition.c +++ b/src/lib/condition.c @@ -30,8 +30,8 @@ * @param self is a pointer to the condition variable to be initialized * @return self as given */ -LumieraCondition -lumiera_condition_init (LumieraCondition self) +CinelerraCondition +cinelerra_condition_init (CinelerraCondition self) { if (self) { @@ -47,15 +47,15 @@ lumiera_condition_init (LumieraCondition self) * @param self is a pointer to the condition variable to be destroyed * @return self as given */ -LumieraCondition -lumiera_condition_destroy (LumieraCondition self) +CinelerraCondition +cinelerra_condition_destroy (CinelerraCondition self) { if (self) { if (pthread_mutex_destroy (&self->mutex)) - LUMIERA_DIE; + CINELERRA_DIE; else if (pthread_cond_destroy (&self->cond)) - LUMIERA_DIE; + CINELERRA_DIE; } return self; } diff --git a/src/lib/condition.h b/src/lib/condition.h index b2fd76c63..73da3685f 100644 --- a/src/lib/condition.h +++ b/src/lib/condition.h @@ -19,8 +19,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#ifndef LUMIERA_CONDITION_H -#define LUMIERA_CONDITION_H +#ifndef CINELERRA_CONDITION_H +#define CINELERRA_CONDITION_H #include "lib/locking.h" @@ -33,21 +33,21 @@ * Condition variables. * */ -struct lumiera_condition_struct +struct cinelerra_condition_struct { pthread_cond_t cond; pthread_mutex_t mutex; }; -typedef struct lumiera_condition_struct lumiera_condition; -typedef lumiera_condition* LumieraCondition; +typedef struct cinelerra_condition_struct cinelerra_condition; +typedef cinelerra_condition* CinelerraCondition; -LumieraCondition -lumiera_condition_init (LumieraCondition self); +CinelerraCondition +cinelerra_condition_init (CinelerraCondition self); -LumieraCondition -lumiera_condition_destroy (LumieraCondition self); +CinelerraCondition +cinelerra_condition_destroy (CinelerraCondition self); /** @@ -55,14 +55,14 @@ lumiera_condition_destroy (LumieraCondition self); * @param self condition variable to be signaled, must be given, all errors are fatal */ static inline void -lumiera_condition_signal (LumieraCondition self) +cinelerra_condition_signal (CinelerraCondition self) { REQUIRE (self); if (pthread_mutex_lock (&self->mutex)) - LUMIERA_DIE; + CINELERRA_DIE; pthread_cond_signal (&self->cond); if (pthread_mutex_unlock (&self->mutex)) - LUMIERA_DIE; + CINELERRA_DIE; } /** @@ -70,14 +70,14 @@ lumiera_condition_signal (LumieraCondition self) * @param self condition variable to be signaled, must be given, all errors are fatal */ static inline void -lumiera_condition_broadcast (LumieraCondition self) +cinelerra_condition_broadcast (CinelerraCondition self) { REQUIRE (self); if (pthread_mutex_lock (&self->mutex)) - LUMIERA_DIE; + CINELERRA_DIE; pthread_cond_broadcast (&self->cond); if (pthread_mutex_unlock (&self->mutex)) - LUMIERA_DIE; + CINELERRA_DIE; } @@ -87,44 +87,44 @@ lumiera_condition_broadcast (LumieraCondition self) /** * conditionacquirer used to manage the state of a condition variable. */ -struct lumiera_conditionacquirer_struct +struct cinelerra_conditionacquirer_struct { - LumieraCondition cond; - enum lumiera_lockstate state; + CinelerraCondition cond; + enum cinelerra_lockstate state; }; -typedef struct lumiera_conditionacquirer_struct lumiera_conditionacquirer; -typedef struct lumiera_conditionacquirer_struct* LumieraConditionacquirer; +typedef struct cinelerra_conditionacquirer_struct cinelerra_conditionacquirer; +typedef struct cinelerra_conditionacquirer_struct* CinelerraConditionacquirer; /* helper function for nobug */ static inline void -lumiera_conditionacquirer_ensureunlocked (LumieraConditionacquirer self) +cinelerra_conditionacquirer_ensureunlocked (CinelerraConditionacquirer self) { - ENSURE (self->state == LUMIERA_UNLOCKED, "forgot to unlock the condition mutex"); + ENSURE (self->state == CINELERRA_UNLOCKED, "forgot to unlock the condition mutex"); } /* override with a macro to use the cleanup checker */ -#define lumiera_conditionacquirer \ -lumiera_conditionacquirer NOBUG_CLEANUP(lumiera_conditionacquirer_ensureunlocked) +#define cinelerra_conditionacquirer \ +cinelerra_conditionacquirer NOBUG_CLEANUP(cinelerra_conditionacquirer_ensureunlocked) /** * initialize a conditionacquirer state * @param self conditionacquirer to be initialized, must be an automatic variable * @param cond associated condition variable - * @param state initial state of the mutex, either LUMIERA_LOCKED or LUMIERA_UNLOCKED + * @param state initial state of the mutex, either CINELERRA_LOCKED or CINELERRA_UNLOCKED * @return self as given * errors are fatal */ -static inline LumieraConditionacquirer -lumiera_conditionacquirer_init (LumieraConditionacquirer self, LumieraCondition cond, enum lumiera_lockstate state) +static inline CinelerraConditionacquirer +cinelerra_conditionacquirer_init (CinelerraConditionacquirer self, CinelerraCondition cond, enum cinelerra_lockstate state) { REQUIRE (self); REQUIRE (cond); self->cond = cond; self->state = state; - if (state == LUMIERA_LOCKED) + if (state == CINELERRA_LOCKED) if (pthread_mutex_lock (&cond->mutex)) - LUMIERA_DIE; + CINELERRA_DIE; return self; } @@ -135,15 +135,15 @@ lumiera_conditionacquirer_init (LumieraConditionacquirer self, LumieraCondition * @param self conditionacquirer associated with a condition variable */ static inline void -lumiera_conditionacquirer_lock (LumieraConditionacquirer self) +cinelerra_conditionacquirer_lock (CinelerraConditionacquirer self) { REQUIRE (self); - REQUIRE (self->state == LUMIERA_UNLOCKED, "mutex already locked"); + REQUIRE (self->state == CINELERRA_UNLOCKED, "mutex already locked"); if (pthread_mutex_lock (&self->cond->mutex)) - LUMIERA_DIE; + CINELERRA_DIE; - self->state = LUMIERA_LOCKED; + self->state = CINELERRA_LOCKED; } @@ -153,10 +153,10 @@ lumiera_conditionacquirer_lock (LumieraConditionacquirer self) * @param self conditionacquirer associated with a condition variable */ static inline void -lumiera_conditionacquirer_wait (LumieraConditionacquirer self) +cinelerra_conditionacquirer_wait (CinelerraConditionacquirer self) { REQUIRE (self); - REQUIRE (self->state == LUMIERA_LOCKED, "mutex must be locked"); + REQUIRE (self->state == CINELERRA_LOCKED, "mutex must be locked"); pthread_cond_wait (&self->cond->cond, &self->cond->mutex); } @@ -167,13 +167,13 @@ lumiera_conditionacquirer_wait (LumieraConditionacquirer self) * @param self conditionacquirer associated with a condition variable */ static inline int -lumiera_conditionacquirer_unlock (LumieraConditionacquirer self) +cinelerra_conditionacquirer_unlock (CinelerraConditionacquirer self) { REQUIRE (self); - REQUIRE (self->state == LUMIERA_LOCKED, "mutex was not locked"); + REQUIRE (self->state == CINELERRA_LOCKED, "mutex was not locked"); if (pthread_mutex_unlock (&self->cond->mutex)) - LUMIERA_DIE; - self->state = LUMIERA_UNLOCKED; + CINELERRA_DIE; + self->state = CINELERRA_UNLOCKED; } @@ -182,10 +182,10 @@ lumiera_conditionacquirer_unlock (LumieraConditionacquirer self) * @param self conditionacquirer associated with the condition variable to be signaled */ static inline void -lumiera_conditionacquirer_signal (LumieraConditionacquirer self) +cinelerra_conditionacquirer_signal (CinelerraConditionacquirer self) { REQUIRE (self); - REQUIRE (self->state == LUMIERA_LOCKED, "mutex was not locked"); + REQUIRE (self->state == CINELERRA_LOCKED, "mutex was not locked"); pthread_cond_signal (&self->cond->cond); } @@ -195,10 +195,10 @@ lumiera_conditionacquirer_signal (LumieraConditionacquirer self) * @param self conditionacquirer associated with the condition variable to be signaled */ static inline int -lumiera_conditionacquirer_broadcast (LumieraConditionacquirer self) +cinelerra_conditionacquirer_broadcast (CinelerraConditionacquirer self) { REQUIRE (self); - REQUIRE (self->state == LUMIERA_LOCKED, "mutex was not locked"); + REQUIRE (self->state == CINELERRA_LOCKED, "mutex was not locked"); pthread_cond_broadcast (&self->cond->cond); } diff --git a/src/lib/error.c b/src/lib/error.c index 81e24bad8..df881013b 100644 --- a/src/lib/error.c +++ b/src/lib/error.c @@ -1,5 +1,5 @@ /* - error.c - Lumiera Error handling + error.c - Cinelerra Error handling Copyright (C) Lumiera.org 2008, Christian Thaeter @@ -24,41 +24,41 @@ #include "lib/error.h" /** - * @file C Error handling in Lumiera. + * @file C Error handling in Cinelerra. */ /* predefined errors */ -LUMIERA_ERROR_DEFINE (ERRNO, "errno"); +CINELERRA_ERROR_DEFINE (ERRNO, "errno"); /* Thread local storage */ -static pthread_key_t lumiera_error_tls; -static pthread_once_t lumiera_error_initialized = PTHREAD_ONCE_INIT; +static pthread_key_t cinelerra_error_tls; +static pthread_once_t cinelerra_error_initialized = PTHREAD_ONCE_INIT; static void -lumiera_error_tls_init (void) +cinelerra_error_tls_init (void) { - pthread_key_create (&lumiera_error_tls, NULL); + pthread_key_create (&cinelerra_error_tls, NULL); } /** * Set error state for the current thread. * If the error state of the current thread was cleared, then set it, else preserve the old state. - * @param nerr name of the error with 'LUMIERA_ERROR_' prefix (example: LUMIERA_ERROR_NO_MEMORY) + * @param nerr name of the error with 'CINELERRA_ERROR_' prefix (example: CINELERRA_ERROR_NO_MEMORY) * @return old state, that is NULL for success, when the state was cleared and a pointer to a pending * error when the error state was already set */ const char* -lumiera_error_set (const char * nerr) +cinelerra_error_set (const char * nerr) { - pthread_once (&lumiera_error_initialized, lumiera_error_tls_init); + pthread_once (&cinelerra_error_initialized, cinelerra_error_tls_init); - const char* err = pthread_getspecific (lumiera_error_tls); + const char* err = pthread_getspecific (cinelerra_error_tls); if (!err) - pthread_setspecific (lumiera_error_tls, nerr); + pthread_setspecific (cinelerra_error_tls, nerr); return err; } @@ -71,12 +71,12 @@ lumiera_error_set (const char * nerr) * @return pointer to any pending error of this thread, NULL if no error is pending */ const char* -lumiera_error () +cinelerra_error () { - pthread_once (&lumiera_error_initialized, lumiera_error_tls_init); + pthread_once (&cinelerra_error_initialized, cinelerra_error_tls_init); - const char* err = pthread_getspecific (lumiera_error_tls); + const char* err = pthread_getspecific (cinelerra_error_tls); if (err) - pthread_setspecific (lumiera_error_tls, NULL); + pthread_setspecific (cinelerra_error_tls, NULL); return err; } diff --git a/src/lib/error.h b/src/lib/error.h index 24c73f0a5..322487de1 100644 --- a/src/lib/error.h +++ b/src/lib/error.h @@ -1,5 +1,5 @@ /* - error.h - Lumiera Error handling + error.h - Cinelerra Error handling Copyright (C) Lumiera.org 2008, Christian Thaeter @@ -18,8 +18,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#ifndef LUMIERA_ERROR_H -#define LUMIERA_ERROR_H +#ifndef CINELERRA_ERROR_H +#define CINELERRA_ERROR_H #ifdef __cplusplus extern "C" { @@ -31,7 +31,7 @@ extern "C" { #include /** - * @file C Error handling in Lumiera, header. + * @file C Error handling in Cinelerra, header. */ @@ -39,46 +39,46 @@ extern "C" { * Abort unconditionally with a 'Fatal Error!' message. * This macro is used whenever the program end up in a invalid state from which no runtime recovery is possible */ -#define LUMIERA_DIE do { NOBUG_ERROR(NOBUG_ON, "Fatal Error!"); abort(); } while(0) +#define CINELERRA_DIE do { NOBUG_ERROR(NOBUG_ON, "Fatal Error!"); abort(); } while(0) /** * Forward declare an error constant. * This macro eases the error declaration in header files - * @param err name of the error without the 'LUMIERA_ERROR_' prefix (example: NO_MEMORY) + * @param err name of the error without the 'CINELERRA_ERROR_' prefix (example: NO_MEMORY) */ -#define LUMIERA_ERROR_DECLARE(err) \ -extern const char* LUMIERA_ERROR_##err +#define CINELERRA_ERROR_DECLARE(err) \ +extern const char* CINELERRA_ERROR_##err /** * Definition and initialization of an error constant. * This macro eases the error definition in implementation files - * @param err name of the error without the 'LUMIERA_ERROR_' prefix (example: NO_MEMORY) + * @param err name of the error without the 'CINELERRA_ERROR_' prefix (example: NO_MEMORY) * @param msg message describing the error in plain english (example: "memory allocation failed") */ -#define LUMIERA_ERROR_DEFINE(err, msg) \ -const char* LUMIERA_ERROR_##err = "LUMIERA_ERROR_" #err ":" msg +#define CINELERRA_ERROR_DEFINE(err, msg) \ +const char* CINELERRA_ERROR_##err = "CINELERRA_ERROR_" #err ":" msg /** Helper macro to raise an error for the current thread. * This macro eases setting an error. It adds NoBug logging support to the low level error handling. * @param flag NoBug flag describing the subsystem where the error was raised - * @param err name of the error without the 'LUMIERA_ERROR_' prefix (example: NO_MEMORY) + * @param err name of the error without the 'CINELERRA_ERROR_' prefix (example: NO_MEMORY) */ -#define LUMIERA_ERROR_SET(flag, err) \ -(({ERROR (flag, "%s", strchr(LUMIERA_ERROR_##err, ':')+1);}), \ -lumiera_error_set(LUMIERA_ERROR_##err)) +#define CINELERRA_ERROR_SET(flag, err) \ +(({ERROR (flag, "%s", strchr(CINELERRA_ERROR_##err, ':')+1);}), \ +cinelerra_error_set(CINELERRA_ERROR_##err)) const char* -lumiera_error_set (const char * err); +cinelerra_error_set (const char * err); const char* -lumiera_error (); +cinelerra_error (); /* predefined errors */ -LUMIERA_ERROR_DECLARE (ERRNO); +CINELERRA_ERROR_DECLARE (ERRNO); #ifdef __cplusplus } /* extern "C" */ #endif -#endif /* LUMIERA_ERROR_H */ +#endif /* CINELERRA_ERROR_H */ diff --git a/src/lib/framerate.c b/src/lib/framerate.c index d8a2fa830..717bab4bb 100644 --- a/src/lib/framerate.c +++ b/src/lib/framerate.c @@ -26,5 +26,5 @@ */ -LUMIERA_ERROR_DEFINE(FRAMERATE_ILLEGAL_TIME, "invalid time given"); -LUMIERA_ERROR_DEFINE(FRAMERATE_ILLEGAL_FRAME, "invalid frame given"); +CINELERRA_ERROR_DEFINE(FRAMERATE_ILLEGAL_TIME, "invalid time given"); +CINELERRA_ERROR_DEFINE(FRAMERATE_ILLEGAL_FRAME, "invalid frame given"); diff --git a/src/lib/framerate.h b/src/lib/framerate.h index 6b050c86e..c7c9d2adc 100644 --- a/src/lib/framerate.h +++ b/src/lib/framerate.h @@ -19,8 +19,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#ifndef LUMIERA_FRAMERATE_H -#define LUMIERA_FRAMERATE_H +#ifndef CINELERRA_FRAMERATE_H +#define CINELERRA_FRAMERATE_H #include @@ -36,37 +36,37 @@ * framerates are defined as a rational number * for example NTSC with 30000/1001fps */ -struct lumiera_framerate_struct +struct cinelerra_framerate_struct { unsigned n; //numerator unsigned d; //denominator }; -typedef struct lumiera_framerate_struct lumiera_framerate; -typedef lumiera_framerate* LumieraFramerate; +typedef struct cinelerra_framerate_struct cinelerra_framerate; +typedef cinelerra_framerate* CinelerraFramerate; -typedef signed long lumiera_framepos; +typedef signed long cinelerra_framepos; -LUMIERA_ERROR_DECLARE(FRAMERATE_ILLEGAL_TIME); -LUMIERA_ERROR_DECLARE(FRAMERATE_ILLEGAL_FRAME); +CINELERRA_ERROR_DECLARE(FRAMERATE_ILLEGAL_TIME); +CINELERRA_ERROR_DECLARE(FRAMERATE_ILLEGAL_FRAME); -#define LUMIERA_FRAMEPOS_ERROR LONG_MIN +#define CINELERRA_FRAMEPOS_ERROR LONG_MIN /** * Get the frame number of a given time at a given frame rate. * frame indexing starts with 1 * @param framerate is a pointer to the framerate used, defined as rational number. Must be given. - * @param time is a pointer to a lumiera_time which shall be converted. - * @return frame at the given time or LUMIERA_FRAMEPOS_ERROR on error. + * @param time is a pointer to a cinelerra_time which shall be converted. + * @return frame at the given time or CINELERRA_FRAMEPOS_ERROR on error. */ -static inline lumiera_framepos -lumiera_framerate_frame_get_time (const LumieraFramerate framerate, LumieraTime time) +static inline cinelerra_framepos +cinelerra_framerate_frame_get_time (const CinelerraFramerate framerate, CinelerraTime time) { REQUIRE (framerate); if (!time || time->tv_sec == (time_t)-1) { - lumiera_error_set(LUMIERA_ERROR_FRAMERATE_ILLEGAL_TIME); - return LUMIERA_FRAMEPOS_ERROR; + cinelerra_error_set(CINELERRA_ERROR_FRAMERATE_ILLEGAL_TIME); + return CINELERRA_FRAMEPOS_ERROR; } /* we add a magic microsecond for rounding, because of integer truncation frames may be calculated at most 1us earlier, @@ -79,21 +79,21 @@ lumiera_framerate_frame_get_time (const LumieraFramerate framerate, LumieraTime * Get the start time for a frame. * frame indexing starts with 1 * @param framerate is a pointer to the framerate used, defined as rational number. Must be given. - * @param time is a pointer to a lumiera_time which shall take the result. + * @param time is a pointer to a cinelerra_time which shall take the result. * @param frame frame number to be converted to time. This frame number must be greater than 0. * @return the pointer given in time or NULL on error (or when it was given as time). */ -static inline LumieraTime -lumiera_framerate_time_get_time_frame (const LumieraFramerate framerate, - LumieraTime time, - lumiera_framepos frame) +static inline CinelerraTime +cinelerra_framerate_time_get_time_frame (const CinelerraFramerate framerate, + CinelerraTime time, + cinelerra_framepos frame) { REQUIRE (framerate); if (time) { if (frame < 1) { - lumiera_error_set(LUMIERA_ERROR_FRAMERATE_ILLEGAL_FRAME); + cinelerra_error_set(CINELERRA_ERROR_FRAMERATE_ILLEGAL_FRAME); return NULL; } diff --git a/src/lib/locking.h b/src/lib/locking.h index 01ad8bb29..2cf7f3700 100644 --- a/src/lib/locking.h +++ b/src/lib/locking.h @@ -19,8 +19,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#ifndef LUMIERA_LOCKING_H -#define LUMIERA_LOCKING_H +#ifndef CINELERRA_LOCKING_H +#define CINELERRA_LOCKING_H #include #include @@ -37,12 +37,12 @@ * * */ -enum lumiera_lockstate +enum cinelerra_lockstate { - LUMIERA_UNLOCKED, - LUMIERA_LOCKED, - LUMIERA_RDLOCKED, - LUMIERA_WRLOCKED + CINELERRA_UNLOCKED, + CINELERRA_LOCKED, + CINELERRA_RDLOCKED, + CINELERRA_WRLOCKED }; #endif diff --git a/src/lib/mutex.c b/src/lib/mutex.c index a08d89e51..b644c00ca 100644 --- a/src/lib/mutex.c +++ b/src/lib/mutex.c @@ -31,8 +31,8 @@ * @param self is a pointer to the mutex to be initialized * @return self as given */ -LumieraMutex -lumiera_mutex_init (LumieraMutex self) +CinelerraMutex +cinelerra_mutex_init (CinelerraMutex self) { if (self) { @@ -46,13 +46,13 @@ lumiera_mutex_init (LumieraMutex self) * @param self is a pointer to the mutex to be destroyed * @return self as given */ -LumieraMutex -lumiera_mutex_destroy (LumieraMutex self) +CinelerraMutex +cinelerra_mutex_destroy (CinelerraMutex self) { if (self) { if (pthread_mutex_destroy (&self->mutex)) - LUMIERA_DIE; + CINELERRA_DIE; } return self; } diff --git a/src/lib/mutex.h b/src/lib/mutex.h index ced7118e2..4dc4bac92 100644 --- a/src/lib/mutex.h +++ b/src/lib/mutex.h @@ -19,8 +19,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#ifndef LUMIERA_MUTEX_H -#define LUMIERA_MUTEX_H +#ifndef CINELERRA_MUTEX_H +#define CINELERRA_MUTEX_H #include "lib/locking.h" @@ -33,58 +33,58 @@ * Mutex. * */ -struct lumiera_mutex_struct +struct cinelerra_mutex_struct { pthread_mutex_t mutex; }; -typedef struct lumiera_mutex_struct lumiera_mutex; -typedef lumiera_mutex* LumieraMutex; +typedef struct cinelerra_mutex_struct cinelerra_mutex; +typedef cinelerra_mutex* CinelerraMutex; -LumieraMutex -lumiera_mutex_init (LumieraMutex self); +CinelerraMutex +cinelerra_mutex_init (CinelerraMutex self); -LumieraMutex -lumiera_mutex_destroy (LumieraMutex self); +CinelerraMutex +cinelerra_mutex_destroy (CinelerraMutex self); /** * mutexacquirer used to manage the state of a mutex variable. */ -struct lumiera_mutexacquirer_struct +struct cinelerra_mutexacquirer_struct { - LumieraMutex mutex; - enum lumiera_lockstate state; + CinelerraMutex mutex; + enum cinelerra_lockstate state; }; -typedef struct lumiera_mutexacquirer_struct lumiera_mutexacquirer; -typedef struct lumiera_mutexacquirer_struct* LumieraMutexacquirer; +typedef struct cinelerra_mutexacquirer_struct cinelerra_mutexacquirer; +typedef struct cinelerra_mutexacquirer_struct* CinelerraMutexacquirer; /* helper function for nobug */ static inline void -lumiera_mutexacquirer_ensureunlocked (LumieraMutexacquirer self) +cinelerra_mutexacquirer_ensureunlocked (CinelerraMutexacquirer self) { - ENSURE (self->state == LUMIERA_UNLOCKED, "forgot to unlock mutex"); + ENSURE (self->state == CINELERRA_UNLOCKED, "forgot to unlock mutex"); } /* override with a macro to use the cleanup checker */ -#define lumiera_mutexacquirer \ -lumiera_mutexacquirer NOBUG_CLEANUP(lumiera_mutexacquirer_ensureunlocked) +#define cinelerra_mutexacquirer \ +cinelerra_mutexacquirer NOBUG_CLEANUP(cinelerra_mutexacquirer_ensureunlocked) /** * initialize a mutexacquirer state without mutex. * @param self mutexacquirer to be initialized, must be an automatic variable * @return self as given - * This initialization is used when lumiera_mutexacquirer_try_mutex shall be used later + * This initialization is used when cinelerra_mutexacquirer_try_mutex shall be used later */ -static inline LumieraMutexacquirer -lumiera_mutexacquirer_init (LumieraMutexacquirer self) +static inline CinelerraMutexacquirer +cinelerra_mutexacquirer_init (CinelerraMutexacquirer self) { REQUIRE (self); self->mutex = NULL; - self->state = LUMIERA_UNLOCKED; + self->state = CINELERRA_UNLOCKED; return self; } @@ -93,20 +93,20 @@ lumiera_mutexacquirer_init (LumieraMutexacquirer self) * initialize a mutexacquirer state * @param self mutexacquirer to be initialized, must be an automatic variable * @param mutex associated mutex - * @param state initial state of the mutex, either LUMIERA_LOCKED or LUMIERA_UNLOCKED + * @param state initial state of the mutex, either CINELERRA_LOCKED or CINELERRA_UNLOCKED * @return self as given * errors are fatal */ -static inline LumieraMutexacquirer -lumiera_mutexacquirer_init_mutex (LumieraMutexacquirer self, LumieraMutex mutex, enum lumiera_lockstate state) +static inline CinelerraMutexacquirer +cinelerra_mutexacquirer_init_mutex (CinelerraMutexacquirer self, CinelerraMutex mutex, enum cinelerra_lockstate state) { REQUIRE (self); REQUIRE (mutex); self->mutex = mutex; self->state = state; - if (state == LUMIERA_LOCKED) + if (state == CINELERRA_LOCKED) if (pthread_mutex_lock (&mutex->mutex)) - LUMIERA_DIE; + CINELERRA_DIE; return self; } @@ -118,25 +118,25 @@ lumiera_mutexacquirer_init_mutex (LumieraMutexacquirer self, LumieraMutex mutex, * @param self mutexacquirer associated with a mutex variable */ static inline void -lumiera_mutexacquirer_lock (LumieraMutexacquirer self) +cinelerra_mutexacquirer_lock (CinelerraMutexacquirer self) { REQUIRE (self); - REQUIRE (self->state == LUMIERA_UNLOCKED, "mutex already locked"); + REQUIRE (self->state == CINELERRA_UNLOCKED, "mutex already locked"); if (pthread_mutex_lock (&self->mutex->mutex)) - LUMIERA_DIE; + CINELERRA_DIE; - self->state = LUMIERA_LOCKED; + self->state = CINELERRA_LOCKED; } /** * get the state of a lock. * @param self mutexacquirer associated with a mutex variable - * @return LUMIERA_LOCKED when the mutex is locked by this thead + * @return CINELERRA_LOCKED when the mutex is locked by this thead */ -static inline enum lumiera_lockstate -lumiera_mutexacquirer_state (LumieraMutexacquirer self) +static inline enum cinelerra_lockstate +cinelerra_mutexacquirer_state (CinelerraMutexacquirer self) { REQUIRE (self); return self->state; @@ -148,23 +148,23 @@ lumiera_mutexacquirer_state (LumieraMutexacquirer self) * must not already be locked * @param self mutexacquirer associated with a mutex variable * @param mutex pointer to a mutex which should be tried - * @return LUMIERA_LOCKED when the mutex got locked + * @return CINELERRA_LOCKED when the mutex got locked */ -static inline enum lumiera_lockstate -lumiera_mutexacquirer_try_mutex (LumieraMutexacquirer self, LumieraMutex mutex) +static inline enum cinelerra_lockstate +cinelerra_mutexacquirer_try_mutex (CinelerraMutexacquirer self, CinelerraMutex mutex) { REQUIRE (self); - REQUIRE (self->state == LUMIERA_UNLOCKED, "mutex already locked"); + REQUIRE (self->state == CINELERRA_UNLOCKED, "mutex already locked"); self->mutex=mutex; switch (pthread_mutex_trylock (&self->mutex->mutex)) { case 0: - return self->state = LUMIERA_LOCKED; + return self->state = CINELERRA_LOCKED; case EBUSY: - return LUMIERA_UNLOCKED; + return CINELERRA_UNLOCKED; default: - LUMIERA_DIE; + CINELERRA_DIE; } } @@ -175,13 +175,13 @@ lumiera_mutexacquirer_try_mutex (LumieraMutexacquirer self, LumieraMutex mutex) * @param self mutexacquirer associated with a mutex variable */ static inline void -lumiera_mutexacquirer_unlock (LumieraMutexacquirer self) +cinelerra_mutexacquirer_unlock (CinelerraMutexacquirer self) { REQUIRE (self); - REQUIRE (self->state == LUMIERA_LOCKED, "mutex was not locked"); + REQUIRE (self->state == CINELERRA_LOCKED, "mutex was not locked"); if (pthread_mutex_unlock (&self->mutex->mutex)) - LUMIERA_DIE; - self->state = LUMIERA_UNLOCKED; + CINELERRA_DIE; + self->state = CINELERRA_UNLOCKED; } #endif diff --git a/src/lib/plugin.c b/src/lib/plugin.c index 87939533d..f819f4a6a 100644 --- a/src/lib/plugin.c +++ b/src/lib/plugin.c @@ -1,5 +1,5 @@ /* - plugin.c - Lumiera Plugin loader + plugin.c - Cinelerra Plugin loader Copyright (C) Lumiera.org 2008, Christian Thaeter @@ -34,48 +34,48 @@ /* TODO should be set by the build system to the actual plugin path */ -#define LUMIERA_PLUGIN_PATH "~/.lumiera/plugins:/usr/local/lib/lumiera/plugins:.libs" +#define CINELERRA_PLUGIN_PATH "~/.cinelerra3/plugins:/usr/local/lib/cinelerra3/plugins:.libs" -NOBUG_DEFINE_FLAG (lumiera_plugin); +NOBUG_DEFINE_FLAG (cinelerra_plugin); /* errors */ -LUMIERA_ERROR_DEFINE(PLUGIN_DLOPEN, "Could not open plugin"); -LUMIERA_ERROR_DEFINE(PLUGIN_HOOK, "Hook function failed"); -LUMIERA_ERROR_DEFINE(PLUGIN_NFILE, "No such plugin"); -LUMIERA_ERROR_DEFINE(PLUGIN_NIFACE, "No such interface"); -LUMIERA_ERROR_DEFINE(PLUGIN_REVISION, "Interface revision too old"); +CINELERRA_ERROR_DEFINE(PLUGIN_DLOPEN, "Could not open plugin"); +CINELERRA_ERROR_DEFINE(PLUGIN_HOOK, "Hook function failed"); +CINELERRA_ERROR_DEFINE(PLUGIN_NFILE, "No such plugin"); +CINELERRA_ERROR_DEFINE(PLUGIN_NIFACE, "No such interface"); +CINELERRA_ERROR_DEFINE(PLUGIN_REVISION, "Interface revision too old"); /* supported (planned) plugin types and their file extensions */ -enum lumiera_plugin_type +enum cinelerra_plugin_type { - LUMIERA_PLUGIN_NULL, - LUMIERA_PLUGIN_DYNLIB, - LUMIERA_PLUGIN_CSOURCE + CINELERRA_PLUGIN_NULL, + CINELERRA_PLUGIN_DYNLIB, + CINELERRA_PLUGIN_CSOURCE }; static const struct { const char* const ext; - enum lumiera_plugin_type type; -} lumiera_plugin_extensions [] = + enum cinelerra_plugin_type type; +} cinelerra_plugin_extensions [] = { - {"so", LUMIERA_PLUGIN_DYNLIB}, - {"o", LUMIERA_PLUGIN_DYNLIB}, - {"c", LUMIERA_PLUGIN_CSOURCE}, + {"so", CINELERRA_PLUGIN_DYNLIB}, + {"o", CINELERRA_PLUGIN_DYNLIB}, + {"c", CINELERRA_PLUGIN_CSOURCE}, /* extend here */ - {NULL, LUMIERA_PLUGIN_NULL} + {NULL, CINELERRA_PLUGIN_NULL} }; -struct lumiera_plugin +struct cinelerra_plugin { /* short name as queried ("effects/audio/normalize") used for sorting/finding */ const char* name; - /* long names as looked up ("/usr/local/lib/lumiera/plugins/effects/audio/normalize.so") */ + /* long names as looked up ("/usr/local/lib/cinelerra3/plugins/effects/audio/normalize.so") */ const char* pathname; /* use count for all interfaces of this plugin */ @@ -85,7 +85,7 @@ struct lumiera_plugin time_t last; /* kind of plugin */ - enum lumiera_plugin_type type; + enum cinelerra_plugin_type type; /* dlopen handle */ void* handle; @@ -93,19 +93,19 @@ struct lumiera_plugin /* global plugin registry */ -void* lumiera_plugin_registry = NULL; +void* cinelerra_plugin_registry = NULL; /* plugin operations are protected by one big mutex */ -pthread_mutex_t lumiera_plugin_mutex = PTHREAD_MUTEX_INITIALIZER; +pthread_mutex_t cinelerra_plugin_mutex = PTHREAD_MUTEX_INITIALIZER; /** * the compare function for the registry tree. - * Compares the names of two struct lumiera_plugin. + * Compares the names of two struct cinelerra_plugin. * @return 0 if a and b are equal, just like strcmp. */ static int -lumiera_plugin_name_cmp (const void* a, const void* b) +cinelerra_plugin_name_cmp (const void* a, const void* b) { - return strcmp (((struct lumiera_plugin*) a)->name, ((struct lumiera_plugin*) b)->name); + return strcmp (((struct cinelerra_plugin*) a)->name, ((struct cinelerra_plugin*) b)->name); } /** @@ -113,21 +113,21 @@ lumiera_plugin_name_cmp (const void* a, const void* b) * always succeeds or aborts */ void -lumiera_init_plugin (void) +cinelerra_init_plugin (void) { - NOBUG_INIT_FLAG (lumiera_plugin); + NOBUG_INIT_FLAG (cinelerra_plugin); } /** * Find and set pathname for the plugin. * Searches through given path for given plugin, trying to find the file's location in the filesystem. * If found, self->pathname will be set to the found plugin file. - * @param self The lumiera_plugin to open look for. + * @param self The cinelerra_plugin to open look for. * @param path The path to search trough (paths seperated by ":") * @return 0 on success. -1 on error, or if plugin not found in path. */ int -lumiera_plugin_lookup (struct lumiera_plugin* self, const char* path) +cinelerra_plugin_lookup (struct cinelerra_plugin* self, const char* path) { if (!path) return -1; @@ -146,22 +146,22 @@ lumiera_plugin_lookup (struct lumiera_plugin* self, const char* path) for (char* tok = strtok_r (tpath, ":", &tmp); tok; tok = strtok_r (NULL, ":", &tmp)) { /*for each extension*/ - for (int i = 0; lumiera_plugin_extensions[i].ext; ++i) + for (int i = 0; cinelerra_plugin_extensions[i].ext; ++i) { /* path/name.extension */ - int r = snprintf(pathname, 1024, "%s/%s.%s", tok, self->name, lumiera_plugin_extensions[i].ext); + int r = snprintf(pathname, 1024, "%s/%s.%s", tok, self->name, cinelerra_plugin_extensions[i].ext); if (r >= 1024) return -1; /*TODO error handling, name too long*/ - TRACE (lumiera_plugin, "trying %s", pathname); + TRACE (cinelerra_plugin, "trying %s", pathname); if (!access(pathname, R_OK)) { /* got it */ - TRACE (lumiera_plugin, "found %s", pathname); + TRACE (cinelerra_plugin, "found %s", pathname); self->pathname = strdup (pathname); - if (!self->pathname) LUMIERA_DIE; - self->type = lumiera_plugin_extensions[i].type; + if (!self->pathname) CINELERRA_DIE; + self->type = cinelerra_plugin_extensions[i].type; return 0; } } @@ -181,44 +181,44 @@ lumiera_plugin_lookup (struct lumiera_plugin* self, const char* path) * @return handle to the interface or NULL in case of a error. The application shall cast this handle to * the actual interface type. */ -struct lumiera_interface* -lumiera_interface_open (const char* name, const char* interface, size_t min_revision) +struct cinelerra_interface* +cinelerra_interface_open (const char* name, const char* interface, size_t min_revision) { - //REQUIRE (min_revision > sizeof(struct lumiera_interface), "try to use an empty interface eh?"); + //REQUIRE (min_revision > sizeof(struct cinelerra_interface), "try to use an empty interface eh?"); REQUIRE (interface, "interface name must be given"); - pthread_mutex_lock (&lumiera_plugin_mutex); + pthread_mutex_lock (&cinelerra_plugin_mutex); - struct lumiera_plugin plugin; - struct lumiera_plugin** found; + struct cinelerra_plugin plugin; + struct cinelerra_plugin** found; plugin.name = name; /* for searching */ - found = tsearch (&plugin, &lumiera_plugin_registry, lumiera_plugin_name_cmp); - if (!found) LUMIERA_DIE; + found = tsearch (&plugin, &cinelerra_plugin_registry, cinelerra_plugin_name_cmp); + if (!found) CINELERRA_DIE; if (*found == &plugin) { - NOTICE (lumiera_plugin, "new plugin"); + NOTICE (cinelerra_plugin, "new plugin"); /* now really create new item */ - *found = malloc (sizeof (struct lumiera_plugin)); - if (!*found) LUMIERA_DIE; + *found = malloc (sizeof (struct cinelerra_plugin)); + if (!*found) CINELERRA_DIE; if (name) /* NULL is main app, no lookup needed */ { - /*lookup for $LUMIERA_PLUGIN_PATH*/ + /*lookup for $CINELERRA_PLUGIN_PATH*/ (*found)->name = strdup (name); - if (!(*found)->name) LUMIERA_DIE; + if (!(*found)->name) CINELERRA_DIE; - if (!!lumiera_plugin_lookup (*found, getenv("LUMIERA_PLUGIN_PATH")) -#ifdef LUMIERA_PLUGIN_PATH - /* else lookup for -DLUMIERA_PLUGIN_PATH */ - && !!lumiera_plugin_lookup (*found, LUMIERA_PLUGIN_PATH) + if (!!cinelerra_plugin_lookup (*found, getenv("CINELERRA_PLUGIN_PATH")) +#ifdef CINELERRA_PLUGIN_PATH + /* else lookup for -DCINELERRA_PLUGIN_PATH */ + && !!cinelerra_plugin_lookup (*found, CINELERRA_PLUGIN_PATH) #endif ) { - LUMIERA_ERROR_SET (lumiera_plugin, PLUGIN_NFILE); + CINELERRA_ERROR_SET (cinelerra_plugin, PLUGIN_NFILE); goto elookup; } } @@ -233,46 +233,46 @@ lumiera_interface_open (const char* name, const char* interface, size_t min_revi PLANNED("if .so like then dlopen; else if .c like tcc compile"); TODO("factor dlopen and dlsym out"); - TRACE(lumiera_plugin, "trying to open %s", (*found)->pathname); + TRACE(cinelerra_plugin, "trying to open %s", (*found)->pathname); (*found)->handle = dlopen ((*found)->pathname, RTLD_LAZY|RTLD_LOCAL); if (!(*found)->handle) { - ERROR (lumiera_plugin, "dlopen failed: %s", dlerror()); - LUMIERA_ERROR_SET (lumiera_plugin, PLUGIN_DLOPEN); + ERROR (cinelerra_plugin, "dlopen failed: %s", dlerror()); + CINELERRA_ERROR_SET (cinelerra_plugin, PLUGIN_DLOPEN); goto edlopen; } - /* if the plugin defines a 'lumiera_plugin_init' function, we call it, must return 0 on success */ - int (*init)(void) = dlsym((*found)->handle, "lumiera_plugin_init"); + /* if the plugin defines a 'cinelerra_plugin_init' function, we call it, must return 0 on success */ + int (*init)(void) = dlsym((*found)->handle, "cinelerra_plugin_init"); if (init && init()) { - //ERROR (lumiera_plugin, "lumiera_plugin_init failed: %s: %s", name, interface); - LUMIERA_ERROR_SET (lumiera_plugin, PLUGIN_HOOK); + //ERROR (cinelerra_plugin, "cinelerra_plugin_init failed: %s: %s", name, interface); + CINELERRA_ERROR_SET (cinelerra_plugin, PLUGIN_HOOK); goto einit; } } /* we have the plugin, now get the interface descriptor */ - struct lumiera_interface* ret; + struct cinelerra_interface* ret; dlerror(); ret = dlsym ((*found)->handle, interface); const char *dlerr = dlerror(); - TRACE(lumiera_plugin, "%s", dlerr); - TODO ("need some way to tell 'interface not provided by plugin', maybe lumiera_plugin_error()?"); + TRACE(cinelerra_plugin, "%s", dlerr); + TODO ("need some way to tell 'interface not provided by plugin', maybe cinelerra_plugin_error()?"); if (dlerr) { - //ERROR (lumiera_plugin, "plugin %s doesnt provide interface %s", name, interface); - LUMIERA_ERROR_SET (lumiera_plugin, PLUGIN_NIFACE); + //ERROR (cinelerra_plugin, "plugin %s doesnt provide interface %s", name, interface); + CINELERRA_ERROR_SET (cinelerra_plugin, PLUGIN_NIFACE); goto edlsym; } /* is the interface older than required? */ if (ret->size < min_revision) { - ERROR (lumiera_plugin, "plugin %s provides older interface %s revision than required", name, interface); - LUMIERA_ERROR_SET (lumiera_plugin, PLUGIN_REVISION); + ERROR (cinelerra_plugin, "plugin %s provides older interface %s revision than required", name, interface); + CINELERRA_ERROR_SET (cinelerra_plugin, PLUGIN_REVISION); goto erevision; } @@ -281,8 +281,8 @@ lumiera_interface_open (const char* name, const char* interface, size_t min_revi /* if the interface provides a 'open' function, call it now, must return 0 on success */ if (ret->open && ret->open()) { - ERROR (lumiera_plugin, "open hook indicated an error"); - LUMIERA_ERROR_SET (lumiera_plugin, PLUGIN_HOOK); + ERROR (cinelerra_plugin, "open hook indicated an error"); + CINELERRA_ERROR_SET (cinelerra_plugin, PLUGIN_HOOK); goto eopen; } @@ -290,7 +290,7 @@ lumiera_interface_open (const char* name, const char* interface, size_t min_revi (*found)->last = time (NULL); ret->use_count++; - pthread_mutex_unlock (&lumiera_plugin_mutex); + pthread_mutex_unlock (&cinelerra_plugin_mutex); return ret; /* Error cleanup */ @@ -304,8 +304,8 @@ lumiera_interface_open (const char* name, const char* interface, size_t min_revi free ((char*)(*found)->name); free (*found); *found = &plugin; - tdelete (&plugin, &lumiera_plugin_registry, lumiera_plugin_name_cmp); - pthread_mutex_unlock (&lumiera_plugin_mutex); + tdelete (&plugin, &cinelerra_plugin_registry, cinelerra_plugin_name_cmp); + pthread_mutex_unlock (&cinelerra_plugin_mutex); return NULL; } @@ -315,17 +315,17 @@ lumiera_interface_open (const char* name, const char* interface, size_t min_revi * @param ptr interface to be closed */ void -lumiera_interface_close (void* ptr) +cinelerra_interface_close (void* ptr) { - TRACE (lumiera_plugin, "%p", ptr); + TRACE (cinelerra_plugin, "%p", ptr); if(!ptr) return; - struct lumiera_interface* self = (struct lumiera_interface*) ptr; + struct cinelerra_interface* self = (struct cinelerra_interface*) ptr; - pthread_mutex_lock (&lumiera_plugin_mutex); + pthread_mutex_lock (&cinelerra_plugin_mutex); - struct lumiera_plugin* plugin = self->plugin; + struct cinelerra_plugin* plugin = self->plugin; plugin->use_count--; self->use_count--; @@ -339,16 +339,16 @@ lumiera_interface_close (void* ptr) { TODO ("we dont want to close here, instead store time of recent use and make a expire run, already planned in my head"); - /* if the plugin defines a 'lumiera_plugin_destroy' function, we call it */ - int (*destroy)(void) = dlsym(plugin->handle, "lumiera_plugin_destroy"); + /* if the plugin defines a 'cinelerra_plugin_destroy' function, we call it */ + int (*destroy)(void) = dlsym(plugin->handle, "cinelerra_plugin_destroy"); if (destroy) destroy(); /* and now cleanup */ - tdelete (plugin, &lumiera_plugin_registry, lumiera_plugin_name_cmp); + tdelete (plugin, &cinelerra_plugin_registry, cinelerra_plugin_name_cmp); free ((char*)plugin->name); dlclose(plugin->handle); free (plugin); } - pthread_mutex_unlock (&lumiera_plugin_mutex); + pthread_mutex_unlock (&cinelerra_plugin_mutex); } diff --git a/src/lib/plugin.h b/src/lib/plugin.h index f8916ae96..45a22bf29 100644 --- a/src/lib/plugin.h +++ b/src/lib/plugin.h @@ -18,8 +18,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#ifndef LUMIERA_PLUGIN_H -#define LUMIERA_PLUGIN_H +#ifndef CINELERRA_PLUGIN_H +#define CINELERRA_PLUGIN_H #ifdef __cplusplus extern "C" { @@ -37,55 +37,55 @@ extern "C" { */ -NOBUG_DECLARE_FLAG (lumiera_plugin); +NOBUG_DECLARE_FLAG (cinelerra_plugin); /* tool macros*/ -#define LUMIERA_INTERFACE_TYPE(name, version) struct lumiera_interface_##name##_##version -#define LUMIERA_INTERFACE_CAST(name, version) (LUMIERA_INTERFACE_TYPE(name, version)*) +#define CINELERRA_INTERFACE_TYPE(name, version) struct cinelerra_interface_##name##_##version +#define CINELERRA_INTERFACE_CAST(name, version) (CINELERRA_INTERFACE_TYPE(name, version)*) /* Interface definition */ -#define LUMIERA_INTERFACE(name, version, ...) \ -LUMIERA_INTERFACE_TYPE(name, version) \ +#define CINELERRA_INTERFACE(name, version, ...) \ +CINELERRA_INTERFACE_TYPE(name, version) \ { \ - struct lumiera_interface interface_header_; \ + struct cinelerra_interface interface_header_; \ __VA_ARGS__ \ } -#define LUMIERA_INTERFACE_PROTO(ret, name, params) ret (*name) params; +#define CINELERRA_INTERFACE_PROTO(ret, name, params) ret (*name) params; /* Interface instantiation */ -#define LUMIERA_INTERFACE_IMPLEMENT(iname, version, name, open, close, ...) \ -LUMIERA_INTERFACE_TYPE(iname, version) name##_##version = \ -{ \ - { \ - version, \ - sizeof(LUMIERA_INTERFACE_TYPE(iname, version)), \ - NULL, \ - 0, \ - open, \ - close \ - }, \ - __VA_ARGS__ \ +#define CINELERRA_INTERFACE_IMPLEMENT(iname, version, name, open, close, ...) \ +CINELERRA_INTERFACE_TYPE(iname, version) name##_##version = \ +{ \ + { \ + version, \ + sizeof(CINELERRA_INTERFACE_TYPE(iname, version)), \ + NULL, \ + 0, \ + open, \ + close \ + }, \ + __VA_ARGS__ \ } /* internally used */ -struct lumiera_plugin; +struct cinelerra_plugin; /** * This is the header for any interface exported by plugins. * Real interfaces append their functions at the end. There are few standard functions on each Interface * Every function is required to be implemnted. */ -struct lumiera_interface +struct cinelerra_interface { /// interface version number unsigned version; /// size of the full structure is used to determine the revision (adding a new function increments the size) size_t size; /// back reference to plugin - struct lumiera_plugin* plugin; + struct cinelerra_plugin* plugin; /// incremented for each user of this interface and decremented when closed unsigned use_count; @@ -96,15 +96,15 @@ struct lumiera_interface }; void -lumiera_init_plugin (void); +cinelerra_init_plugin (void); -struct lumiera_interface* -lumiera_interface_open (const char* plugin, const char* name, size_t min_revision); +struct cinelerra_interface* +cinelerra_interface_open (const char* plugin, const char* name, size_t min_revision); void -lumiera_interface_close (void* self); +cinelerra_interface_close (void* self); /** * Tries to unload a plugin. @@ -113,24 +113,24 @@ lumiera_interface_close (void* self); * @return 0 on success, else the number if users which keeping the plugin loaded */ int -lumiera_plugin_unload (const char* plugin); +cinelerra_plugin_unload (const char* plugin); /** * Tries to unload plugins which are not in use. - * Calls lumiera_plugin_unload() for each Plugin which is not used for more than age seconds. + * Calls cinelerra_plugin_unload() for each Plugin which is not used for more than age seconds. * This function might be infrequently called by the scheduler to remove things which are not needed. * @param age timeout in seconds when to unload plugins */ void -lumiera_plugin_expire (time_t age); +cinelerra_plugin_expire (time_t age); -LUMIERA_ERROR_DECLARE(PLUGIN_DLOPEN); -LUMIERA_ERROR_DECLARE(PLUGIN_HOOK); -LUMIERA_ERROR_DECLARE(PLUGIN_NFILE); -LUMIERA_ERROR_DECLARE(PLUGIN_NIFACE); -LUMIERA_ERROR_DECLARE(PLUGIN_REVISION); +CINELERRA_ERROR_DECLARE(PLUGIN_DLOPEN); +CINELERRA_ERROR_DECLARE(PLUGIN_HOOK); +CINELERRA_ERROR_DECLARE(PLUGIN_NFILE); +CINELERRA_ERROR_DECLARE(PLUGIN_NIFACE); +CINELERRA_ERROR_DECLARE(PLUGIN_REVISION); #ifdef __cplusplus } /* extern "C" */ #endif -#endif /* LUMIERA_PLUGIN_H */ +#endif /* CINELERRA_PLUGIN_H */ diff --git a/src/lib/references.c b/src/lib/references.c index ad4f9562f..a4c5eb247 100644 --- a/src/lib/references.c +++ b/src/lib/references.c @@ -40,17 +40,17 @@ * @param dtor destructor function which will be called on obj when the last strong reference gets deleted * @return self as given */ -LumieraReference -lumiera_reference_strong_init_once (LumieraReference self, void* obj, void (*dtor)(void*)) +CinelerraReference +cinelerra_reference_strong_init_once (CinelerraReference self, void* obj, void (*dtor)(void*)) { - LumieraReftarget target = malloc (sizeof(lumiera_reftarget)); - if (!target) LUMIERA_DIE; + CinelerraReftarget target = malloc (sizeof(cinelerra_reftarget)); + if (!target) CINELERRA_DIE; target->object = obj; target->dtor = dtor; target->strong_cnt = 1; target->weak_cnt = 0; - lumiera_mutex_init (&target->lock); + cinelerra_mutex_init (&target->lock); self->object = obj; self->target = target; @@ -66,16 +66,16 @@ lumiera_reference_strong_init_once (LumieraReference self, void* obj, void (*dto * @return self as given * destroying a reference is not thread safe as far as 2 threads try to concurrently destroy it! */ -LumieraReference -lumiera_reference_destroy (LumieraReference self) +CinelerraReference +cinelerra_reference_destroy (CinelerraReference self) { - LumieraReftarget target = self->target; + CinelerraReftarget target = self->target; /* defensive, lets detect errors if anything still tries to use this reference */ self->target = NULL; - lumiera_mutexacquirer lock; - lumiera_mutexacquirer_init_mutex (&lock, &target->lock, LUMIERA_LOCKED); + cinelerra_mutexacquirer lock; + cinelerra_mutexacquirer_init_mutex (&lock, &target->lock, CINELERRA_LOCKED); if (self->object) { @@ -89,8 +89,8 @@ lumiera_reference_destroy (LumieraReference self) if (!target->weak_cnt) { /* no weak refs either, destroy it */ - lumiera_mutexacquirer_unlock (&lock); - lumiera_mutex_destroy (&target->lock); + cinelerra_mutexacquirer_unlock (&lock); + cinelerra_mutex_destroy (&target->lock); free (target); return self; } @@ -102,13 +102,13 @@ lumiera_reference_destroy (LumieraReference self) if (!--target->weak_cnt && !target->strong_cnt) { /* was last weak reference, and no strong refs left */ - lumiera_mutexacquirer_unlock (&lock); - lumiera_mutex_destroy (&target->lock); + cinelerra_mutexacquirer_unlock (&lock); + cinelerra_mutex_destroy (&target->lock); free (target); return self; } } - lumiera_mutexacquirer_unlock (&lock); + cinelerra_mutexacquirer_unlock (&lock); return self; } @@ -118,11 +118,11 @@ lumiera_reference_destroy (LumieraReference self) * @return self as strong reference (always for strong references) or NULL if source is an invalidated weak reference, * in the later case the reference is constructed as weak reference barely to allow it be destroyed */ -LumieraReference -lumiera_reference_strong_init (LumieraReference self, LumieraReference source) +CinelerraReference +cinelerra_reference_strong_init (CinelerraReference self, CinelerraReference source) { - lumiera_mutexacquirer lock; - lumiera_mutexacquirer_init_mutex (&lock, &source->target->lock, LUMIERA_LOCKED); + cinelerra_mutexacquirer lock; + cinelerra_mutexacquirer_init_mutex (&lock, &source->target->lock, CINELERRA_LOCKED); self->object = source->target->object; self->target = source->target; @@ -136,7 +136,7 @@ lumiera_reference_strong_init (LumieraReference self, LumieraReference source) ++self->target->weak_cnt; self = NULL; } - lumiera_mutexacquirer_unlock (&lock); + cinelerra_mutexacquirer_unlock (&lock); return self; } @@ -145,11 +145,11 @@ lumiera_reference_strong_init (LumieraReference self, LumieraReference source) * @param source reference to copy * @return self (always for strong references) or NULL if self is an invalidated weak reference */ -LumieraReference -lumiera_reference_weak_init (LumieraReference self, LumieraReference source) +CinelerraReference +cinelerra_reference_weak_init (CinelerraReference self, CinelerraReference source) { - lumiera_mutexacquirer lock; - lumiera_mutexacquirer_init_mutex (&lock, &source->target->lock, LUMIERA_LOCKED); + cinelerra_mutexacquirer lock; + cinelerra_mutexacquirer_init_mutex (&lock, &source->target->lock, CINELERRA_LOCKED); self->object = NULL; self->target = source->target; @@ -159,7 +159,7 @@ lumiera_reference_weak_init (LumieraReference self, LumieraReference source) /* already invalidated */ self = NULL; - lumiera_mutexacquirer_unlock (&lock); + cinelerra_mutexacquirer_unlock (&lock); return self; } @@ -169,14 +169,14 @@ lumiera_reference_weak_init (LumieraReference self, LumieraReference source) * do nothing if the referene is already weak * @return self or NULL if the final strong reference got removed, */ -LumieraReference -lumiera_reference_weaken (restrict LumieraReference self) +CinelerraReference +cinelerra_reference_weaken (restrict CinelerraReference self) { /* is this a strong reference? */ if (self->object) { - lumiera_mutexacquirer lock; - lumiera_mutexacquirer_init_mutex (&lock, &self->target->lock, LUMIERA_LOCKED); + cinelerra_mutexacquirer lock; + cinelerra_mutexacquirer_init_mutex (&lock, &self->target->lock, CINELERRA_LOCKED); self->object = NULL; ++self->target->weak_cnt; @@ -187,7 +187,7 @@ lumiera_reference_weaken (restrict LumieraReference self) self->target->object = NULL; self = NULL; } - lumiera_mutexacquirer_unlock (&lock); + cinelerra_mutexacquirer_unlock (&lock); } return self; } @@ -198,14 +198,14 @@ lumiera_reference_weaken (restrict LumieraReference self) * only references of object which are not already destroyed can be strengthened * @return self when successful, NULL when the object was already destroyed, 'self' stays a dead weak reference in that case */ -LumieraReference -lumiera_reference_strengthen (LumieraReference self) +CinelerraReference +cinelerra_reference_strengthen (CinelerraReference self) { /* is this a weak reference? */ if (!self->object) { - lumiera_mutexacquirer lock; - lumiera_mutexacquirer_init_mutex (&lock, &self->target->lock, LUMIERA_LOCKED); + cinelerra_mutexacquirer lock; + cinelerra_mutexacquirer_init_mutex (&lock, &self->target->lock, CINELERRA_LOCKED); if (self->target->object) { @@ -215,7 +215,7 @@ lumiera_reference_strengthen (LumieraReference self) } else self = NULL; - lumiera_mutexacquirer_unlock (&lock); + cinelerra_mutexacquirer_unlock (&lock); } return self; } diff --git a/src/lib/references.h b/src/lib/references.h index 3e00457e7..a7de3f7f0 100644 --- a/src/lib/references.h +++ b/src/lib/references.h @@ -19,8 +19,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#ifndef LUMIERA_REFERENCES_H -#define LUMIERA_REFERENCES_H +#ifndef CINELERRA_REFERENCES_H +#define CINELERRA_REFERENCES_H #include @@ -29,77 +29,77 @@ */ -typedef struct lumiera_reference_struct lumiera_reference; -typedef lumiera_reference* LumieraReference; +typedef struct cinelerra_reference_struct cinelerra_reference; +typedef cinelerra_reference* CinelerraReference; #include "lib/error.h" #include "lib/mutex.h" /* Implementation detail */ -struct lumiera_reftarget_struct +struct cinelerra_reftarget_struct { void* object; void (*dtor)(void*); unsigned strong_cnt; /*when strong becomes 0 obj is destroyed, if weak is 0 destroy target too*/ unsigned weak_cnt; /*when weak becomes 0 and !obj and lock strong is 0, destroy target */ - lumiera_mutex lock; + cinelerra_mutex lock; }; -typedef struct lumiera_reftarget_struct lumiera_reftarget; -typedef lumiera_reftarget* LumieraReftarget; +typedef struct cinelerra_reftarget_struct cinelerra_reftarget; +typedef cinelerra_reftarget* CinelerraReftarget; /** * A reference pointing to some other object */ -struct lumiera_reference_struct +struct cinelerra_reference_struct { void* object; /*set for strong, NULL for weak*/ - LumieraReftarget target; + CinelerraReftarget target; }; -#define lumiera_reference \ -lumiera_reference NOBUG_CLEANUP(lumiera_reference_ensuredestroyed) +#define cinelerra_reference \ +cinelerra_reference NOBUG_CLEANUP(cinelerra_reference_ensuredestroyed) /* helper function for nobug */ static inline void -lumiera_reference_ensuredestroyed (LumieraReference self) +cinelerra_reference_ensuredestroyed (CinelerraReference self) { ENSURE (!self->target, "forgot to destroy reference"); } -LumieraReference -lumiera_reference_strong_init_once (LumieraReference self, void* obj, void (*dtor)(void*)); +CinelerraReference +cinelerra_reference_strong_init_once (CinelerraReference self, void* obj, void (*dtor)(void*)); -LumieraReference -lumiera_reference_destroy (LumieraReference self); +CinelerraReference +cinelerra_reference_destroy (CinelerraReference self); /** * Get object from a strong reference. * @return pointer to object, NULL if applied to a weak reference */ static inline void* -lumiera_reference_get (LumieraReference self) +cinelerra_reference_get (CinelerraReference self) { ENSURE (self->target, "illegal reference (not initialized or already destroyed?)"); return self->object; } -LumieraReference -lumiera_reference_strong_init (LumieraReference self, LumieraReference source); +CinelerraReference +cinelerra_reference_strong_init (CinelerraReference self, CinelerraReference source); -LumieraReference -lumiera_reference_weak_init (LumieraReference self, LumieraReference source); +CinelerraReference +cinelerra_reference_weak_init (CinelerraReference self, CinelerraReference source); -LumieraReference -lumiera_reference_weaken (restrict LumieraReference self); +CinelerraReference +cinelerra_reference_weaken (restrict CinelerraReference self); -LumieraReference -lumiera_reference_strengthen (LumieraReference self); +CinelerraReference +cinelerra_reference_strengthen (CinelerraReference self); #endif diff --git a/src/lib/rwlock.c b/src/lib/rwlock.c index c7ee3a37d..d60223e3c 100644 --- a/src/lib/rwlock.c +++ b/src/lib/rwlock.c @@ -23,8 +23,8 @@ #include #include "lib/rwlock.h" -LUMIERA_ERROR_DEFINE(RWLOCK_AGAIN, "maximum number of readlocks exceed"); -LUMIERA_ERROR_DEFINE(RWLOCK_DEADLOCK, "deadlock detected"); +CINELERRA_ERROR_DEFINE(RWLOCK_AGAIN, "maximum number of readlocks exceed"); +CINELERRA_ERROR_DEFINE(RWLOCK_DEADLOCK, "deadlock detected"); /** * @file Read/write locks. @@ -36,8 +36,8 @@ LUMIERA_ERROR_DEFINE(RWLOCK_DEADLOCK, "deadlock detected"); * @param self is a pointer to the rwlock to be initialized * @return self as given */ -LumieraRWLock -lumiera_rwlock_init (LumieraRWLock self) +CinelerraRWLock +cinelerra_rwlock_init (CinelerraRWLock self) { if (self) { @@ -51,13 +51,13 @@ lumiera_rwlock_init (LumieraRWLock self) * @param self is a pointer to the rwlock to be initialized * @return self on success or NULL at error */ -LumieraRWLock -lumiera_rwlock_destroy (LumieraRWLock self) +CinelerraRWLock +cinelerra_rwlock_destroy (CinelerraRWLock self) { if (self) { if (pthread_rwlock_destroy (&self->rwlock)) - LUMIERA_DIE; + CINELERRA_DIE; } return self; } @@ -69,44 +69,44 @@ lumiera_rwlock_destroy (LumieraRWLock self) * initialize a rwlockacquirer state * @param self rwlockacquirer to be initialized, must be an automatic variable * @param rwlock associated rwlock - * @param state initial state of the mutex, either LUMIERA_RDLOCKED, LUMIERA_WRLOCKED or LUMIERA_UNLOCKED + * @param state initial state of the mutex, either CINELERRA_RDLOCKED, CINELERRA_WRLOCKED or CINELERRA_UNLOCKED * @return self as given or NULL on error */ -LumieraRWLockacquirer -lumiera_rwlockacquirer_init (LumieraRWLockacquirer self, LumieraRWLock rwlock, enum lumiera_lockstate state) +CinelerraRWLockacquirer +cinelerra_rwlockacquirer_init (CinelerraRWLockacquirer self, CinelerraRWLock rwlock, enum cinelerra_lockstate state) { REQUIRE (self); REQUIRE (rwlock); - REQUIRE (state != LUMIERA_LOCKED, "illegal state for rwlock"); + REQUIRE (state != CINELERRA_LOCKED, "illegal state for rwlock"); self->rwlock = rwlock; self->state = state; switch (state) { - case LUMIERA_RDLOCKED: + case CINELERRA_RDLOCKED: switch (pthread_rwlock_rdlock (&rwlock->rwlock)) { case 0: break; case EAGAIN: - lumiera_error_set (LUMIERA_ERROR_RWLOCK_AGAIN); + cinelerra_error_set (CINELERRA_ERROR_RWLOCK_AGAIN); return NULL; case EDEADLK: - lumiera_error_set (LUMIERA_ERROR_RWLOCK_DEADLOCK); + cinelerra_error_set (CINELERRA_ERROR_RWLOCK_DEADLOCK); return NULL; default: - LUMIERA_DIE; + CINELERRA_DIE; } - case LUMIERA_WRLOCKED: + case CINELERRA_WRLOCKED: switch (pthread_rwlock_wrlock (&rwlock->rwlock)) { case 0: break; case EDEADLK: - lumiera_error_set (LUMIERA_ERROR_RWLOCK_DEADLOCK); + cinelerra_error_set (CINELERRA_ERROR_RWLOCK_DEADLOCK); return NULL; default: - LUMIERA_DIE; + CINELERRA_DIE; } default: break; @@ -121,27 +121,27 @@ lumiera_rwlockacquirer_init (LumieraRWLockacquirer self, LumieraRWLock rwlock, e * @param self rwlockacquirer associated with a rwlock * @return self as given or NULL on error */ -LumieraRWLockacquirer -lumiera_rwlockacquirer_rdlock (LumieraRWLockacquirer self) +CinelerraRWLockacquirer +cinelerra_rwlockacquirer_rdlock (CinelerraRWLockacquirer self) { REQUIRE (self); - REQUIRE (self->state == LUMIERA_UNLOCKED, "rwlock already locked"); + REQUIRE (self->state == CINELERRA_UNLOCKED, "rwlock already locked"); switch (pthread_rwlock_rdlock (&self->rwlock->rwlock)) { case 0: break; case EAGAIN: - lumiera_error_set (LUMIERA_ERROR_RWLOCK_AGAIN); + cinelerra_error_set (CINELERRA_ERROR_RWLOCK_AGAIN); return NULL; case EDEADLK: - lumiera_error_set (LUMIERA_ERROR_RWLOCK_DEADLOCK); + cinelerra_error_set (CINELERRA_ERROR_RWLOCK_DEADLOCK); return NULL; default: - LUMIERA_DIE; + CINELERRA_DIE; } - self->state = LUMIERA_RDLOCKED; + self->state = CINELERRA_RDLOCKED; return self; } @@ -152,24 +152,24 @@ lumiera_rwlockacquirer_rdlock (LumieraRWLockacquirer self) * @param self rwlockacquirer associated with a rwlock * @return self as given or NULL on error */ -LumieraRWLockacquirer -lumiera_rwlockacquirer_wrlock (LumieraRWLockacquirer self) +CinelerraRWLockacquirer +cinelerra_rwlockacquirer_wrlock (CinelerraRWLockacquirer self) { REQUIRE (self); - REQUIRE (self->state == LUMIERA_UNLOCKED, "rwlock already locked"); + REQUIRE (self->state == CINELERRA_UNLOCKED, "rwlock already locked"); switch (pthread_rwlock_wrlock (&self->rwlock->rwlock)) { case 0: break; case EDEADLK: - lumiera_error_set (LUMIERA_ERROR_RWLOCK_DEADLOCK); + cinelerra_error_set (CINELERRA_ERROR_RWLOCK_DEADLOCK); return NULL; default: - LUMIERA_DIE; + CINELERRA_DIE; } - self->state = LUMIERA_WRLOCKED; + self->state = CINELERRA_WRLOCKED; return self; } diff --git a/src/lib/rwlock.h b/src/lib/rwlock.h index 922a05e7b..266887e24 100644 --- a/src/lib/rwlock.h +++ b/src/lib/rwlock.h @@ -19,8 +19,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#ifndef LUMIERA_RWLOCK_H -#define LUMIERA_RWLOCK_H +#ifndef CINELERRA_RWLOCK_H +#define CINELERRA_RWLOCK_H #ifndef _GNU_SOURCE #error "This header must be included with _GNU_SOURCE or _POSIX_C_SOURCE >= 200112L defined" @@ -31,8 +31,8 @@ #include "lib/locking.h" -LUMIERA_ERROR_DECLARE(RWLOCK_AGAIN); -LUMIERA_ERROR_DECLARE(RWLOCK_DEADLOCK); +CINELERRA_ERROR_DECLARE(RWLOCK_AGAIN); +CINELERRA_ERROR_DECLARE(RWLOCK_DEADLOCK); /** * @file Read/write locks, header. @@ -43,20 +43,20 @@ LUMIERA_ERROR_DECLARE(RWLOCK_DEADLOCK); * RWLock. * */ -struct lumiera_rwlock_struct +struct cinelerra_rwlock_struct { pthread_rwlock_t rwlock; }; -typedef struct lumiera_rwlock_struct lumiera_rwlock; -typedef lumiera_rwlock* LumieraRWLock; +typedef struct cinelerra_rwlock_struct cinelerra_rwlock; +typedef cinelerra_rwlock* CinelerraRWLock; -LumieraRWLock -lumiera_rwlock_init (LumieraRWLock self); +CinelerraRWLock +cinelerra_rwlock_init (CinelerraRWLock self); -LumieraRWLock -lumiera_rwlock_destroy (LumieraRWLock self); +CinelerraRWLock +cinelerra_rwlock_destroy (CinelerraRWLock self); @@ -64,35 +64,35 @@ lumiera_rwlock_destroy (LumieraRWLock self); /** * rwlockacquirer used to manage the state of a rwlock variable. */ -struct lumiera_rwlockacquirer_struct +struct cinelerra_rwlockacquirer_struct { - LumieraRWLock rwlock; - enum lumiera_lockstate state; + CinelerraRWLock rwlock; + enum cinelerra_lockstate state; }; -typedef struct lumiera_rwlockacquirer_struct lumiera_rwlockacquirer; -typedef struct lumiera_rwlockacquirer_struct* LumieraRWLockacquirer; +typedef struct cinelerra_rwlockacquirer_struct cinelerra_rwlockacquirer; +typedef struct cinelerra_rwlockacquirer_struct* CinelerraRWLockacquirer; /* helper function for nobug */ static inline void -lumiera_rwlockacquirer_ensureunlocked (LumieraRWLockacquirer self) +cinelerra_rwlockacquirer_ensureunlocked (CinelerraRWLockacquirer self) { - ENSURE (self->state == LUMIERA_UNLOCKED, "forgot to unlock the rwlock mutex"); + ENSURE (self->state == CINELERRA_UNLOCKED, "forgot to unlock the rwlock mutex"); } /* override with a macro to use the cleanup checker */ -#define lumiera_rwlockacquirer \ -lumiera_rwlockacquirer NOBUG_CLEANUP(lumiera_rwlockacquirer_ensureunlocked) +#define cinelerra_rwlockacquirer \ +cinelerra_rwlockacquirer NOBUG_CLEANUP(cinelerra_rwlockacquirer_ensureunlocked) -LumieraRWLockacquirer -lumiera_rwlockacquirer_init (LumieraRWLockacquirer self, LumieraRWLock rwlock, enum lumiera_lockstate state); +CinelerraRWLockacquirer +cinelerra_rwlockacquirer_init (CinelerraRWLockacquirer self, CinelerraRWLock rwlock, enum cinelerra_lockstate state); -LumieraRWLockacquirer -lumiera_rwlockacquirer_rdlock (LumieraRWLockacquirer self); +CinelerraRWLockacquirer +cinelerra_rwlockacquirer_rdlock (CinelerraRWLockacquirer self); -LumieraRWLockacquirer -lumiera_rwlockacquirer_wrlock (LumieraRWLockacquirer self); +CinelerraRWLockacquirer +cinelerra_rwlockacquirer_wrlock (CinelerraRWLockacquirer self); /** @@ -101,13 +101,13 @@ lumiera_rwlockacquirer_wrlock (LumieraRWLockacquirer self); * @param self rwlockacquirer associated with a rwlock variable */ static inline void -lumiera_rwlockacquirer_unlock (LumieraRWLockacquirer self) +cinelerra_rwlockacquirer_unlock (CinelerraRWLockacquirer self) { REQUIRE (self); - REQUIRE (self->state != LUMIERA_UNLOCKED, "rwlock was not locked"); + REQUIRE (self->state != CINELERRA_UNLOCKED, "rwlock was not locked"); if (pthread_rwlock_unlock (&self->rwlock->rwlock)) - LUMIERA_DIE; - self->state = LUMIERA_UNLOCKED; + CINELERRA_DIE; + self->state = CINELERRA_UNLOCKED; } diff --git a/src/lib/time.c b/src/lib/time.c index 83bfd9797..4566e44b5 100644 --- a/src/lib/time.c +++ b/src/lib/time.c @@ -21,6 +21,6 @@ #include "lib/error.h" -LUMIERA_ERROR_DEFINE(TIME_OVERFLOW, "Time overflow"); -LUMIERA_ERROR_DEFINE(TIME_UNDERFLOW, "Time underflow"); -LUMIERA_ERROR_DEFINE(TIME_NEGATIVE, "Time negative"); +CINELERRA_ERROR_DEFINE(TIME_OVERFLOW, "Time overflow"); +CINELERRA_ERROR_DEFINE(TIME_UNDERFLOW, "Time underflow"); +CINELERRA_ERROR_DEFINE(TIME_NEGATIVE, "Time negative"); diff --git a/src/lib/time.h b/src/lib/time.h index 26b698742..d4c05b71c 100644 --- a/src/lib/time.h +++ b/src/lib/time.h @@ -19,8 +19,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#ifndef LUMIERA_TIME_H -#define LUMIERA_TIME_H +#ifndef CINELERRA_TIME_H +#define CINELERRA_TIME_H #include #include @@ -35,31 +35,31 @@ timehandling is a delicate business, be careful of precision errors accumulating - lumiera_time is starting from zero, never becomes negative. + cinelerra_time is starting from zero, never becomes negative. TODO explain how to use time */ /* over or underflow (tried to make a movie which has negative length? or more than some hundreds days?) */ -LUMIERA_ERROR_DECLARE(TIME_OVERFLOW); -LUMIERA_ERROR_DECLARE(TIME_UNDERFLOW); -LUMIERA_ERROR_DECLARE(TIME_NEGATIVE); +CINELERRA_ERROR_DECLARE(TIME_OVERFLOW); +CINELERRA_ERROR_DECLARE(TIME_UNDERFLOW); +CINELERRA_ERROR_DECLARE(TIME_NEGATIVE); /* Note: we measure time starting from zero, time never becomes negative (I didnt checked if the time types are signed) */ -typedef struct timeval lumiera_time; -typedef lumiera_time* LumieraTime; +typedef struct timeval cinelerra_time; +typedef cinelerra_time* CinelerraTime; /** * normalize time after operations. * used internally */ static inline void -lumiera_time_normalize (LumieraTime time) +cinelerra_time_normalize (CinelerraTime time) { REQUIRE (time); if (time->tv_usec >= 1000000) @@ -75,8 +75,8 @@ lumiera_time_normalize (LumieraTime time) * @param time Time to clear * @return time as given */ -static inline LumieraTime -lumiera_time_clear (LumieraTime time) +static inline CinelerraTime +cinelerra_time_clear (CinelerraTime time) { if(time) { @@ -91,14 +91,14 @@ lumiera_time_clear (LumieraTime time) * @param time Time to put current time into. * @return time as given */ -static inline LumieraTime -lumiera_time_current (LumieraTime time) +static inline CinelerraTime +cinelerra_time_current (CinelerraTime time) { if (time) { /* gettime should never ever fail in a correct program */ if (gettimeofday (time, NULL)) - LUMIERA_DIE; + CINELERRA_DIE; } return time; } @@ -110,8 +110,8 @@ lumiera_time_current (LumieraTime time) * @return time as given upon success, NULL if double time given was negative or given time didn't point * anywhere */ -static inline LumieraTime -lumiera_time_set_double (LumieraTime time, double fp) +static inline CinelerraTime +cinelerra_time_set_double (CinelerraTime time, double fp) { if (time) { @@ -125,7 +125,7 @@ lumiera_time_set_double (LumieraTime time, double fp) { time->tv_sec = (time_t)-1; time->tv_usec = (suseconds_t)-1; - lumiera_error_set(LUMIERA_ERROR_TIME_NEGATIVE); + cinelerra_error_set(CINELERRA_ERROR_TIME_NEGATIVE); } } return NULL; @@ -138,14 +138,14 @@ lumiera_time_set_double (LumieraTime time, double fp) * @param usec Microseconds to set * @param Time as given */ -static inline LumieraTime -lumiera_time_init (LumieraTime time, time_t sec, suseconds_t usec) +static inline CinelerraTime +cinelerra_time_init (CinelerraTime time, time_t sec, suseconds_t usec) { if (time) { time->tv_sec = sec; time->tv_usec = usec; - lumiera_time_normalize (time); + cinelerra_time_normalize (time); } return time; } @@ -156,7 +156,7 @@ lumiera_time_init (LumieraTime time, time_t sec, suseconds_t usec) * @return Seconds elapsed, -1 on error */ static inline time_t -lumiera_time_sec (LumieraTime time) +cinelerra_time_sec (CinelerraTime time) { if (time) return time->tv_sec; @@ -170,7 +170,7 @@ lumiera_time_sec (LumieraTime time) * @return Microseconds elapsed, -1 on error */ static inline suseconds_t -lumiera_time_usec (LumieraTime time) +cinelerra_time_usec (CinelerraTime time) { if (time) return time->tv_usec; @@ -184,7 +184,7 @@ lumiera_time_usec (LumieraTime time) * @return Floating point representation of time. NAN on error. */ static inline double -lumiera_time_double_get (LumieraTime time) +cinelerra_time_double_get (CinelerraTime time) { if (time) { @@ -204,8 +204,8 @@ lumiera_time_double_get (LumieraTime time) * @param src Time-source to copy from * @return dest as given */ -static inline LumieraTime -lumiera_time_copy (LumieraTime dest, const LumieraTime src) +static inline CinelerraTime +cinelerra_time_copy (CinelerraTime dest, const CinelerraTime src) { if (dest && src) { @@ -221,8 +221,8 @@ lumiera_time_copy (LumieraTime dest, const LumieraTime src) * @param src Time to add to dest * @return dest as given, or NULL on overflow. */ -static inline LumieraTime -lumiera_time_add (LumieraTime dest, const LumieraTime src) +static inline CinelerraTime +cinelerra_time_add (CinelerraTime dest, const CinelerraTime src) { if (dest && src) { @@ -231,11 +231,11 @@ lumiera_time_add (LumieraTime dest, const LumieraTime src) dest->tv_sec += src->tv_sec; dest->tv_usec += src->tv_usec; - lumiera_time_normalize (dest); + cinelerra_time_normalize (dest); if (dest->tv_sec < t) { - lumiera_error_set (LUMIERA_ERROR_TIME_OVERFLOW); + cinelerra_error_set (CINELERRA_ERROR_TIME_OVERFLOW); return NULL; } } @@ -248,8 +248,8 @@ lumiera_time_add (LumieraTime dest, const LumieraTime src) * @param src Time to subtract from dest * @return dest as given, or NULL on underflow. */ -static inline LumieraTime -lumiera_time_sub (LumieraTime dest, const LumieraTime src) +static inline CinelerraTime +cinelerra_time_sub (CinelerraTime dest, const CinelerraTime src) { if (dest && src) { @@ -264,11 +264,11 @@ lumiera_time_sub (LumieraTime dest, const LumieraTime src) dest->tv_usec += 1000000 - src->tv_usec; } - lumiera_time_normalize (dest); + cinelerra_time_normalize (dest); if (dest->tv_sec > t) { - lumiera_error_set (LUMIERA_ERROR_TIME_UNDERFLOW); + cinelerra_error_set (CINELERRA_ERROR_TIME_UNDERFLOW); return NULL; } } diff --git a/src/main.cpp b/src/main.cpp index 398cdc3df..8d564ed87 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -23,11 +23,11 @@ #include -#include "lumiera.h" +#include "cinelerra.h" using std::cout; using std::endl; -using lumiera::Appconfig; +using cinelerra::Appconfig; int main (int argc, char* argv[]) diff --git a/src/nobugcfg.h b/src/nobugcfg.h index 916f28663..2cd719a87 100644 --- a/src/nobugcfg.h +++ b/src/nobugcfg.h @@ -27,7 +27,7 @@ ** The idea is that configuration and some globally used flag ** declarations are to be kept in one central location. Normally, ** this header will be included by appconfig.hpp, which in turn gets - ** included by lumiera.h + ** included by cinelerra.h ** @par Besides the usual guarded declarations, this header contains ** one section with the corresponding definitions. This section ** is to be called by appconfig.cpp only, which deals with application diff --git a/src/plugin/helloplugin.c b/src/plugin/helloplugin.c index d75f55f94..62a033f4e 100644 --- a/src/plugin/helloplugin.c +++ b/src/plugin/helloplugin.c @@ -1,12 +1,12 @@ /* * hello.c - demonstrates how to build a standalone tool (C source) - * integrated into the SCons based build system of Lumiera + * integrated into the SCons based build system of Cinelerra */ #include int main(int argc, char* argv[]) { - printf("hello lumiera world"); + printf("hello cinelerra world"); return 0; } diff --git a/src/pre.hpp b/src/pre.hpp index 19717c2bb..8c504c368 100644 --- a/src/pre.hpp +++ b/src/pre.hpp @@ -33,8 +33,8 @@ ** @see mobject.hpp usage example */ -#ifndef LUMIERA_PRE_HPP -#define LUMIERA_PRE_HPP +#ifndef CINELERRA_PRE_HPP +#define CINELERRA_PRE_HPP #include #include @@ -44,8 +44,8 @@ #include #include -#include "lumiera.h" +#include "cinelerra.h" -#endif /*LUMIERA_PRE_HPP*/ +#endif /*CINELERRA_PRE_HPP*/ diff --git a/src/proc/asset.cpp b/src/proc/asset.cpp index 99fd50670..d97c2fd9e 100644 --- a/src/proc/asset.cpp +++ b/src/proc/asset.cpp @@ -111,7 +111,7 @@ namespace asset /**change the enablement status of this asset. */ bool - Asset::enable (bool on) throw(lumiera::error::State) + Asset::enable (bool on) throw(cinelerra::error::State) { if (on == this->enabled) return true; diff --git a/src/proc/asset.hpp b/src/proc/asset.hpp index 0387e85ba..cec77bec4 100644 --- a/src/proc/asset.hpp +++ b/src/proc/asset.hpp @@ -155,7 +155,7 @@ namespace asset /** origin or authorship id. * Can be a project abbreviation, a package id or just the authors nickname or UID. * This allows for the compnent name to be more generic (e.g. "blur"). - * Default for all assets provided by the core Lumiera codebase is "lumi". + * Default for all assets provided by the core cinelerra-3 codebase is "cin3". */ const string org; @@ -284,7 +284,7 @@ namespace asset * @return \c false if the state could not be changed * due to parent objects being disabled */ - bool enable (bool on=true) throw(lumiera::error::State); + bool enable (bool on=true) throw(cinelerra::error::State); }; diff --git a/src/proc/asset/db.hpp b/src/proc/asset/db.hpp index af31df9a3..9f33b01af 100644 --- a/src/proc/asset/db.hpp +++ b/src/proc/asset/db.hpp @@ -87,7 +87,7 @@ namespace asset DB () : table() { } ~DB () {clear();} - friend class lumiera::singleton::StaticCreate; + friend class cinelerra::singleton::StaticCreate; public: @@ -125,7 +125,7 @@ namespace asset table.clear(); } - catch (lumiera::Error& EX) + catch (cinelerra::Error& EX) { WARN (oper, "Problems while clearing Asset registry: %s", EX.what()); } diff --git a/src/proc/asset/media.cpp b/src/proc/asset/media.cpp index 60a1ecd19..1610e822e 100644 --- a/src/proc/asset/media.cpp +++ b/src/proc/asset/media.cpp @@ -116,7 +116,7 @@ namespace asset } - lumiera::Time + cinelerra::Time Media::getLength() const { return len_; @@ -177,7 +177,7 @@ namespace asset MediaFactory::PType MediaFactory::operator() (const string& file, const Category& cat) { - Asset::Ident key(extractName(file), cat, "lumi", 1); + Asset::Ident key(extractName(file), cat, "cin3", 1); return operator() (key, file); } @@ -220,21 +220,21 @@ namespace asset * but rather part or a multichannel (compound) media */ shared_ptr - MediaFactory::operator() (asset::Media& mediaref) throw(lumiera::error::Invalid) + MediaFactory::operator() (asset::Media& mediaref) throw(cinelerra::error::Invalid) { if (mediaref.checkCompound()) - throw lumiera::error::Invalid (str(format("Attempt to create a asset::Clip from the media %s, " - "which is not toplevel but rather part or a compound " - "(multichannel) media. Found parent Media %s.") - % string(mediaref) - % string(*mediaref.checkCompound())) - ,LUMIERA_ERROR_PART_OF_COMPOUND - ); + throw cinelerra::error::Invalid (str(format("Attempt to create a asset::Clip from the media %s, " + "which is not toplevel but rather part or a compound " + "(multichannel) media. Found parent Media %s.") + % string(mediaref) + % string(*mediaref.checkCompound())) + ,CINELERRA_ERROR_PART_OF_COMPOUND + ); asset::Clip* pC = new asset::Clip (mediaref); return AssetManager::instance().getPtr (*pC); } - LUMIERA_ERROR_DEFINE (PART_OF_COMPOUND, "part of compound used as toplevel element"); + CINELERRA_ERROR_DEFINE (PART_OF_COMPOUND, "part of compound used as toplevel element"); diff --git a/src/proc/asset/media.hpp b/src/proc/asset/media.hpp index ce43d6231..67c6a31ca 100644 --- a/src/proc/asset/media.hpp +++ b/src/proc/asset/media.hpp @@ -50,7 +50,7 @@ namespace asset class MediaFactory; class ProcPatt; - using lumiera::Time; + using cinelerra::Time; template<> @@ -137,7 +137,7 @@ namespace asset /** * Factory specialized for creating Media Asset objects. */ - class MediaFactory : public lumiera::Factory + class MediaFactory : public cinelerra::Factory { public: typedef shared_ptr PType; @@ -151,11 +151,11 @@ namespace asset PType operator() (const char* file, asset::Kind); shared_ptr - operator() (asset::Media& mediaref) throw(lumiera::error::Invalid); + operator() (asset::Media& mediaref) throw(cinelerra::error::Invalid); }; - LUMIERA_ERROR_DECLARE (PART_OF_COMPOUND); + CINELERRA_ERROR_DECLARE (PART_OF_COMPOUND); diff --git a/src/proc/asset/meta.hpp b/src/proc/asset/meta.hpp index 89500c226..e995f53a3 100644 --- a/src/proc/asset/meta.hpp +++ b/src/proc/asset/meta.hpp @@ -90,7 +90,7 @@ namespace asset /** * Factory specialized for createing Metadata Asset objects. */ - class MetaFactory : public lumiera::Factory + class MetaFactory : public cinelerra::Factory { public: typedef shared_ptr PType; diff --git a/src/proc/asset/proc.hpp b/src/proc/asset/proc.hpp index b98fa8014..229f66fcd 100644 --- a/src/proc/asset/proc.hpp +++ b/src/proc/asset/proc.hpp @@ -89,7 +89,7 @@ namespace asset /** * Factory specialized for createing Processor Asset objects. */ - class ProcFactory : public lumiera::Factory + class ProcFactory : public cinelerra::Factory { public: typedef shared_ptr PType; diff --git a/src/proc/asset/struct.hpp b/src/proc/asset/struct.hpp index 96dd63001..24cc5c053 100644 --- a/src/proc/asset/struct.hpp +++ b/src/proc/asset/struct.hpp @@ -91,7 +91,7 @@ namespace asset /** * Factory specialized for createing Structural Asset objects. */ - class StructFactory : public lumiera::Factory + class StructFactory : public cinelerra::Factory { public: typedef shared_ptr PType; diff --git a/src/proc/asset/unknown.cpp b/src/proc/asset/unknown.cpp index b47a60113..25d91936c 100644 --- a/src/proc/asset/unknown.cpp +++ b/src/proc/asset/unknown.cpp @@ -48,19 +48,19 @@ namespace asset * try to access the "real" media it stands for. */ Media::PMedia - Unknown::getOrg() throw(lumiera::error::Invalid) + Unknown::getOrg() throw(cinelerra::error::Invalid) { UNIMPLEMENTED ("how to get at the original media from a »Unknown« placeholder"); if (1==0) - throw lumiera::error::Invalid (str(format("Unable to locate original media " - "for ID=%s, filename=\"%s\".") - % string(this->ident) - % string(this->getFilename())) - ,LUMIERA_ERROR_ORIG_NOT_FOUND - ); + throw cinelerra::error::Invalid (str(format("Unable to locate original media " + "for ID=%s, filename=\"%s\".") + % string(this->ident) + % string(this->getFilename())) + ,CINELERRA_ERROR_ORIG_NOT_FOUND + ); } - LUMIERA_ERROR_DEFINE (ORIG_NOT_FOUND, "Media refered by placeholder not found"); + CINELERRA_ERROR_DEFINE (ORIG_NOT_FOUND, "Media refered by placeholder not found"); diff --git a/src/proc/asset/unknown.hpp b/src/proc/asset/unknown.hpp index bcd0bda9f..aa9cd6ec3 100644 --- a/src/proc/asset/unknown.hpp +++ b/src/proc/asset/unknown.hpp @@ -32,7 +32,7 @@ namespace asset { - const lumiera::Time DUMMY_TIME (25); ///< @todo solve konfig management + const cinelerra::Time DUMMY_TIME (25); ///< @todo solve konfig management /** * Placeholder Asset for unknown or unavailable media source. @@ -47,11 +47,11 @@ namespace asset friend class MediaFactory; public: - virtual Media::PMedia getOrg() throw(lumiera::error::Invalid); + virtual Media::PMedia getOrg() throw(cinelerra::error::Invalid); }; - LUMIERA_ERROR_DECLARE (ORIG_NOT_FOUND); + CINELERRA_ERROR_DECLARE (ORIG_NOT_FOUND); diff --git a/src/proc/assetmanager.cpp b/src/proc/assetmanager.cpp index 68843444a..bc6f42ecd 100644 --- a/src/proc/assetmanager.cpp +++ b/src/proc/assetmanager.cpp @@ -38,8 +38,8 @@ using boost::format; using boost::bind; using util::for_each; -using lumiera::Singleton; -using lumiera::Thread; +using cinelerra::Singleton; +using cinelerra::Thread; namespace asset @@ -49,23 +49,23 @@ namespace asset * AssetManager error responses, caused by querying * invalid Asset IDs from the internal DB. */ - class IDErr : public lumiera::error::Invalid + class IDErr : public cinelerra::error::Invalid { public: IDErr (const char* eID, format fmt) - : lumiera::error::Invalid(fmt.str(),eID) {} + : cinelerra::error::Invalid(fmt.str(),eID) {} }; // ------pre-defined-common-error-cases--------------- // - LUMIERA_ERROR_DEFINE (UNKNOWN_ASSET_ID, "non-registered Asset ID"); - LUMIERA_ERROR_DEFINE (WRONG_ASSET_KIND, "wrong Asset kind, unable to cast"); + CINELERRA_ERROR_DEFINE (UNKNOWN_ASSET_ID, "non-registered Asset ID"); + CINELERRA_ERROR_DEFINE (WRONG_ASSET_KIND, "wrong Asset kind, unable to cast"); class UnknownID : public IDErr { public: - UnknownID (ID aID) : IDErr (LUMIERA_ERROR_UNKNOWN_ASSET_ID, + UnknownID (ID aID) : IDErr (CINELERRA_ERROR_UNKNOWN_ASSET_ID, format("Query for Asset with ID=%d, which up to now " "hasn't been created or encountered.") % aID) {} }; @@ -73,7 +73,7 @@ namespace asset class WrongKind : public IDErr { public: - WrongKind (Asset::Ident idi) : IDErr (LUMIERA_ERROR_WRONG_ASSET_KIND, + WrongKind (Asset::Ident idi) : IDErr (CINELERRA_ERROR_WRONG_ASSET_KIND, format("Request for Asset(%s), specifying an Asset kind, " "that doesn't match the actual type (and can't be " "casted either).") % string(idi)) {} @@ -110,7 +110,7 @@ namespace asset template ID AssetManager::reg (KIND* obj, const Asset::Ident& idi) - throw(lumiera::error::Invalid) + throw(cinelerra::error::Invalid) { typedef shared_ptr PType; AssetManager& _aMang (AssetManager::instance()); @@ -133,7 +133,7 @@ namespace asset template shared_ptr AssetManager::getAsset (const ID& id) - throw(lumiera::error::Invalid) + throw(cinelerra::error::Invalid) { if (shared_ptr obj = registry.get (id)) return obj; @@ -243,11 +243,11 @@ namespace asset template ID AssetManager::reg (Asset* obj, const Asset::Ident& idi); - template shared_ptr AssetManager::getAsset (const ID& id) throw(lumiera::error::Invalid); - template shared_ptr AssetManager::getAsset (const ID& id) throw(lumiera::error::Invalid); - template shared_ptr AssetManager::getAsset (const ID& id) throw(lumiera::error::Invalid); - template shared_ptr AssetManager::getAsset (const ID& id) throw(lumiera::error::Invalid); - template shared_ptr AssetManager::getAsset (const ID& id) throw(lumiera::error::Invalid); + template shared_ptr AssetManager::getAsset (const ID& id) throw(cinelerra::error::Invalid); + template shared_ptr AssetManager::getAsset (const ID& id) throw(cinelerra::error::Invalid); + template shared_ptr AssetManager::getAsset (const ID& id) throw(cinelerra::error::Invalid); + template shared_ptr AssetManager::getAsset (const ID& id) throw(cinelerra::error::Invalid); + template shared_ptr AssetManager::getAsset (const ID& id) throw(cinelerra::error::Invalid); template shared_ptr AssetManager::getPtr (const Asset& asset); template shared_ptr AssetManager::getPtr (const Media& asset); diff --git a/src/proc/assetmanager.hpp b/src/proc/assetmanager.hpp index b2362db00..d1b20e025 100644 --- a/src/proc/assetmanager.hpp +++ b/src/proc/assetmanager.hpp @@ -66,7 +66,7 @@ namespace asset public: - static lumiera::Singleton instance; + static cinelerra::Singleton instance; /** provide the unique ID for given Asset::Ident tuple */ static ID getID (const Asset::Ident&); @@ -77,7 +77,7 @@ namespace asset /** find and return corresponging object */ template - shared_ptr getAsset (const ID& id) throw(lumiera::error::Invalid); + shared_ptr getAsset (const ID& id) throw(cinelerra::error::Invalid); /** @return true if the given id is registered in the internal asset DB */ @@ -101,7 +101,7 @@ namespace asset */ template static ID reg (KIND* obj, const Asset::Ident& idi) - throw(lumiera::error::Invalid); + throw(cinelerra::error::Invalid); /** deleter function used by the Asset smart pointers to delete Asset objects */ static void destroy (Asset* aa) { delete aa; } @@ -110,13 +110,13 @@ namespace asset AssetManager (); - friend class lumiera::singleton::StaticCreate; + friend class cinelerra::singleton::StaticCreate; }; - LUMIERA_ERROR_DECLARE (UNKNOWN_ASSET_ID); ///< use of a non-registered Asset ID. - LUMIERA_ERROR_DECLARE (WRONG_ASSET_KIND); ///< Asset ID of wrong Asset kind, unable to cast. + CINELERRA_ERROR_DECLARE (UNKNOWN_ASSET_ID); ///< use of a non-registered Asset ID. + CINELERRA_ERROR_DECLARE (WRONG_ASSET_KIND); ///< Asset ID of wrong Asset kind, unable to cast. } // namespace asset diff --git a/src/proc/engine/codecadapter.hpp b/src/proc/engine/codecadapter.hpp index 724763eaa..5b4991177 100644 --- a/src/proc/engine/codecadapter.hpp +++ b/src/proc/engine/codecadapter.hpp @@ -38,7 +38,7 @@ namespace engine * process thus is integrated into the framework * of the Renderengine, while the actual implementation * can be delegated to an external library accessed - * through Lumiera's data backend. + * through Cinelerra's datat backend. */ class CodecAdapter : public Trafo {}; diff --git a/src/proc/engine/pluginadapter.hpp b/src/proc/engine/pluginadapter.hpp index b771f1fbc..b080b99ed 100644 --- a/src/proc/engine/pluginadapter.hpp +++ b/src/proc/engine/pluginadapter.hpp @@ -35,7 +35,7 @@ namespace engine /** * Adapter used to integrate an effects processor in the render pipeline. * Effects processors are typically defined in a separate library and - * will be loaded at runtime using Lumiera's plugin interface. + * will be loaded at runtime using Cinelerra's plugin interface. */ class PluginAdapter : public Trafo { diff --git a/src/proc/engine/processor.hpp b/src/proc/engine/processor.hpp index 6b7317886..70ec33f6c 100644 --- a/src/proc/engine/processor.hpp +++ b/src/proc/engine/processor.hpp @@ -24,7 +24,7 @@ #ifndef ENGINE_PROCESSOR_H #define ENGINE_PROCESSOR_H -#include "lumiera.h" +#include "cinelerra.h" #include "proc/stateproxy.hpp" @@ -40,10 +40,10 @@ namespace engine ExitNode * output; /** begin of the timerange covered by this processor */ - lumiera::Time start; + cinelerra::Time start; /**end (exclusive) of the timerange */ - lumiera::Time end; + cinelerra::Time end; }; diff --git a/src/proc/mobject/builder/buildertool.hpp b/src/proc/mobject/builder/buildertool.hpp index 0985567d1..c4700bc0a 100644 --- a/src/proc/mobject/builder/buildertool.hpp +++ b/src/proc/mobject/builder/buildertool.hpp @@ -59,7 +59,7 @@ namespace mobject * an instantiation of the "Applicable" template parametrized with all * concrete Buildable classes, for which it wants calls to be dispatched. */ - typedef lumiera::visitor::Tool BuilderTool; + typedef cinelerra::visitor::Tool BuilderTool; template @@ -67,11 +67,11 @@ namespace mobject class TYPELIST // list of all concrete Buildables to be treated > class Applicable - : public lumiera::visitor::Applicable + : public cinelerra::visitor::Applicable { } ; - using lumiera::typelist::Types; // convienience for the users of "Applicable" + using cinelerra::typelist::Types; // convienience for the users of "Applicable" } // namespace mobject::builder @@ -80,7 +80,7 @@ namespace mobject /** * Marker Interface for classes Visitable by Builder tools. */ - class Buildable : public lumiera::visitor::Visitable + class Buildable : public cinelerra::visitor::Visitable { }; } // namespace mobject diff --git a/src/proc/mobject/mobject.hpp b/src/proc/mobject/mobject.hpp index 3d0222a3d..b7c139f93 100644 --- a/src/proc/mobject/mobject.hpp +++ b/src/proc/mobject/mobject.hpp @@ -29,7 +29,7 @@ #include #include -#include "lumiera.h" +#include "cinelerra.h" #include "proc/mobject/builder/buildertool.hpp" #include "proc/mobject/placement.hpp" #include "proc/asset.hpp" // TODO finally not needed? @@ -55,13 +55,13 @@ namespace mobject /** * MObject is the interface class for all "Media Objects". * All the contents and elements that can be placed and - * manipulated and finally rendered within Lumiera's EDL + * manipulated and finally rendered within Cinelerra's EDL * are MObjects. */ class MObject : public Buildable { protected: - typedef lumiera::Time Time; + typedef cinelerra::Time Time; // TODO: how to represent time intervals best? Time length; diff --git a/src/proc/mobject/placement.hpp b/src/proc/mobject/placement.hpp index 3e941b7d5..71c654308 100644 --- a/src/proc/mobject/placement.hpp +++ b/src/proc/mobject/placement.hpp @@ -86,7 +86,7 @@ namespace mobject class Placement : protected shared_ptr { protected: - typedef lumiera::Time Time; + typedef cinelerra::Time Time; typedef session::Track* Track; diff --git a/src/proc/mobject/session.hpp b/src/proc/mobject/session.hpp index 1dafb2e87..48473d298 100644 --- a/src/proc/mobject/session.hpp +++ b/src/proc/mobject/session.hpp @@ -57,7 +57,7 @@ namespace mobject /** * The (current) Session holds all the user * visible content to be edited and manipulated - * within the Lumiera Application. From a users + * within the Cinelerra Application. From a users * perspective, it is a collection of Media Objects * (--> MObject) placed (--> Placement) onto virtual * Tracks. diff --git a/src/proc/mobject/session/locatingpin.hpp b/src/proc/mobject/session/locatingpin.hpp index c42d5bc3d..dfc7f8696 100644 --- a/src/proc/mobject/session/locatingpin.hpp +++ b/src/proc/mobject/session/locatingpin.hpp @@ -42,7 +42,7 @@ #define MOBJECT_SESSION_LOCATINGPIN_H -#include "lumiera.h" +#include "cinelerra.h" #include #include @@ -79,7 +79,7 @@ namespace mobject class LocatingPin { protected: - typedef lumiera::Time Time; + typedef cinelerra::Time Time; typedef session::Track* Track; typedef std::pair SolutionData; //TODO (ichthyo consideres better passing of solution by subclass) struct LocatingSolution; diff --git a/src/proc/mobject/session/segment.hpp b/src/proc/mobject/session/segment.hpp index 0b8a6025b..46b5929d4 100644 --- a/src/proc/mobject/session/segment.hpp +++ b/src/proc/mobject/session/segment.hpp @@ -26,7 +26,7 @@ #include -#include "lumiera.h" +#include "cinelerra.h" #include "proc/mobject/explicitplacement.hpp" @@ -49,7 +49,7 @@ namespace mobject class Segment { protected: - typedef lumiera::Time Time; + typedef cinelerra::Time Time; /** begin of this timeline segment. */ Time start; diff --git a/src/proc/mobject/session/session.cpp b/src/proc/mobject/session/session.cpp index ea6a559d9..2e81d752e 100644 --- a/src/proc/mobject/session/session.cpp +++ b/src/proc/mobject/session/session.cpp @@ -37,7 +37,7 @@ #include "common/singleton.hpp" -using lumiera::Singleton; +using cinelerra::Singleton; using mobject::session::SessManager; using mobject::session::SessManagerImpl; diff --git a/src/proc/mobject/session/sessionimpl.cpp b/src/proc/mobject/session/sessionimpl.cpp index 15e940843..e0cab87cc 100644 --- a/src/proc/mobject/session/sessionimpl.cpp +++ b/src/proc/mobject/session/sessionimpl.cpp @@ -60,7 +60,7 @@ namespace mobject catch (...) { focusEDL_ = 0; - throw lumiera::error::Fatal ("unexpected exception while clearing EDLs"); + throw cinelerra::error::Fatal ("unexpected exception while clearing EDLs"); } } diff --git a/src/proc/mobject/session/sessionimpl.hpp b/src/proc/mobject/session/sessionimpl.hpp index 2c396f95c..d145c4fe5 100644 --- a/src/proc/mobject/session/sessionimpl.hpp +++ b/src/proc/mobject/session/sessionimpl.hpp @@ -90,7 +90,7 @@ namespace mobject boost::scoped_ptr pImpl_; SessManagerImpl() throw(); - friend class lumiera::singleton::StaticCreate; + friend class cinelerra::singleton::StaticCreate; public: virtual void clear () ; diff --git a/src/tool/hello.c b/src/tool/hello.c index d75f55f94..62a033f4e 100644 --- a/src/tool/hello.c +++ b/src/tool/hello.c @@ -1,12 +1,12 @@ /* * hello.c - demonstrates how to build a standalone tool (C source) - * integrated into the SCons based build system of Lumiera + * integrated into the SCons based build system of Cinelerra */ #include int main(int argc, char* argv[]) { - printf("hello lumiera world"); + printf("hello cinelerra world"); return 0; } diff --git a/tests/10errorhandling.tests b/tests/10errorhandling.tests index f2e4e9dfc..2492869c5 100644 --- a/tests/10errorhandling.tests +++ b/tests/10errorhandling.tests @@ -15,12 +15,12 @@ return: 0 END TEST "query error" get < #include -using lumiera::error::Invalid; +using cinelerra::error::Invalid; using util::for_each; using util::isnil; using std::cout; diff --git a/tests/components/backend/mediaaccessmock.hpp b/tests/components/backend/mediaaccessmock.hpp index 06eedad5c..e11d0a67a 100644 --- a/tests/components/backend/mediaaccessmock.hpp +++ b/tests/components/backend/mediaaccessmock.hpp @@ -41,7 +41,7 @@ namespace backend_interface class MediaAccessMock : public MediaAccessFacade { public: - FileHandle queryFile (const char* name) throw(lumiera::error::Invalid); + FileHandle queryFile (const char* name) throw(cinelerra::error::Invalid); ChanDesc queryChannel (FileHandle, uint chanNo) throw(); }; diff --git a/tests/components/common/appconfigtest.cpp b/tests/components/common/appconfigtest.cpp index 6cab57de8..d65e29402 100644 --- a/tests/components/common/appconfigtest.cpp +++ b/tests/components/common/appconfigtest.cpp @@ -33,7 +33,7 @@ using std::cout; -namespace lumiera +namespace cinelerra { namespace test { @@ -46,10 +46,10 @@ namespace lumiera testAccess("version"); } - /** @test accessing a value from lumiera::Appconfig */ + /** @test accessing a value from cinelerra::Appconfig */ void testAccess (const string& key) { - string ver = lumiera::Appconfig::get(key); + string ver = cinelerra::Appconfig::get(key); ASSERT ( !util::isnil(ver)); } }; diff --git a/tests/components/common/exceptionerrortest.cpp b/tests/components/common/exceptionerrortest.cpp index 75a13d0ee..987c77d19 100644 --- a/tests/components/common/exceptionerrortest.cpp +++ b/tests/components/common/exceptionerrortest.cpp @@ -42,7 +42,7 @@ using std::cout; -namespace lumiera +namespace cinelerra { namespace test { @@ -50,11 +50,11 @@ namespace lumiera /** local specific error-constant for use in the * construcor of the nested SpecificError class. */ - LUMIERA_ERROR_DEFINE(LIFE_AND_UNIVERSE, "and everything?"); - LUMIERA_ERROR_DEFINE(DERIVED, "convoluted exception"); + CINELERRA_ERROR_DEFINE(LIFE_AND_UNIVERSE, "and everything?"); + CINELERRA_ERROR_DEFINE(DERIVED, "convoluted exception"); /** declare a specific Error class with parent class error::external */ - LUMIERA_EXCEPTION_DECLARE (DerivedError, error::External, LUMIERA_ERROR_DERIVED); + CINELERRA_EXCEPTION_DECLARE (DerivedError, error::External, CINELERRA_ERROR_DERIVED); /********************************************************** @@ -134,29 +134,29 @@ namespace lumiera } - /** @test by constructing an lumiera::Error object, - * the corresponding lumiera_error state is set automatically + /** @test by constructing an cinelerra::Error object, + * the corresponding cinelerra_error state is set automatically */ void checkErrorIntegration() { - lumiera_error (); - ASSERT (!lumiera_error ()); + cinelerra_error (); + ASSERT (!cinelerra_error ()); Error err1; - Error err2("boo",LUMIERA_ERROR_DERIVED); - ASSERT (err1.getID () == lumiera_error ()); // (we didn't clear the first one!) + Error err2("boo",CINELERRA_ERROR_DERIVED); + ASSERT (err1.getID () == cinelerra_error ()); // (we didn't clear the first one!) - Error err3("boooo",LUMIERA_ERROR_DERIVED); - ASSERT (err3.getID () == lumiera_error ()); + Error err3("boooo",CINELERRA_ERROR_DERIVED); + ASSERT (err3.getID () == cinelerra_error ()); SpecificError err4; - ASSERT (err4.getID () == LUMIERA_ERROR_LIFE_AND_UNIVERSE); - ASSERT (err4.getID () == lumiera_error ()); + ASSERT (err4.getID () == CINELERRA_ERROR_LIFE_AND_UNIVERSE); + ASSERT (err4.getID () == cinelerra_error ()); - ASSERT (!lumiera_error ()); + ASSERT (!cinelerra_error ()); } - /** @test the chaining of lumiera::Exception objects + /** @test the chaining of cinelerra::Exception objects * and the retrieval of the original root cause. */ void checkRootCauseChaining() @@ -186,7 +186,7 @@ namespace lumiera * gets installed and invoked, which gives additional diagnostics.*/ void terminateUnknown () throw() { - lumiera::Appconfig::instance(); + cinelerra::Appconfig::instance(); // will cause initialisation of Appconfig, throw Error("You'll never get me, won't you?"); @@ -201,7 +201,7 @@ namespace lumiera { int value; public: - SpecificError () : Invalid("don't panic",LUMIERA_ERROR_LIFE_AND_UNIVERSE), value(42) {} + SpecificError () : Invalid("don't panic",CINELERRA_ERROR_LIFE_AND_UNIVERSE), value(42) {} int revealIt () { return value; } }; @@ -220,7 +220,7 @@ namespace lumiera catch (SpecificError& e) { cout << "caught: " << e.what() << "..the answer is: " << e.revealIt() << "\n"; } catch (error::Logic& e) { cout << "caught error::Logic: " << e.what() << "\n"; } catch (error::Invalid&e) { cout << "caught error::Invalid: " << e.what() << "\n"; } - catch (Error& e) { cout << "caught lumiera::Error: " << e.what() << "\n"; } + catch (Error& e) { cout << "caught cinelerra::Error: " << e.what() << "\n"; } catch (runtime_error& e) { cout << "caught std::runtime_error: " << e.what() << "\n"; } catch (exception& e) { cout << "caught std::exception: " << e.what() << "\n"; } catch (...) { cout << "caught an unknown exception\n"; } diff --git a/tests/components/common/factoryspecialtest.cpp b/tests/components/common/factoryspecialtest.cpp index ecf293cd9..de9eeee8b 100644 --- a/tests/components/common/factoryspecialtest.cpp +++ b/tests/components/common/factoryspecialtest.cpp @@ -38,7 +38,7 @@ using std::string; using std::cout; -namespace lumiera +namespace cinelerra { namespace test { @@ -323,4 +323,4 @@ namespace lumiera } // namespace test -} // namespace lumiera +} // namespace cinelerra diff --git a/tests/components/common/factorytest.cpp b/tests/components/common/factorytest.cpp index 6c96a337c..875266fce 100644 --- a/tests/components/common/factorytest.cpp +++ b/tests/components/common/factorytest.cpp @@ -36,7 +36,7 @@ using std::string; using std::cout; -namespace lumiera +namespace cinelerra { namespace test { @@ -100,7 +100,7 @@ namespace lumiera * further shared-ptrs, invoke a member function and * finally, when leaving the scope, our TargetObj * will be destroyed automatically. - * @see lumiera::Factory + * @see cinelerra::Factory */ class Factory_test : public Test { @@ -125,4 +125,4 @@ namespace lumiera } // namespace test -} // namespace lumiera +} // namespace cinelerra diff --git a/tests/components/common/singletontest.cpp b/tests/components/common/singletontest.cpp index b531d7e9c..558d7e674 100644 --- a/tests/components/common/singletontest.cpp +++ b/tests/components/common/singletontest.cpp @@ -38,7 +38,7 @@ using std::string; using std::cout; -namespace lumiera +namespace cinelerra { namespace test { @@ -72,9 +72,9 @@ namespace lumiera /******************************************************************* * @test implement a Singleton class using our Singleton Template. * Expected results: no memory leaks. - * @see lumiera::Singleton - * @see lumiera::singleton::StaticCreate - * @see lumiera::singleton::HeapCreate + * @see cinelerra::Singleton + * @see cinelerra::singleton::StaticCreate + * @see cinelerra::singleton::HeapCreate */ class Singleton_test : public Test { @@ -136,4 +136,4 @@ namespace lumiera } // namespace test -} // namespace lumiera +} // namespace cinelerra diff --git a/tests/components/common/singletontestmocktest.cpp b/tests/components/common/singletontestmocktest.cpp index ea5e1d70e..b90b1a73c 100644 --- a/tests/components/common/singletontestmocktest.cpp +++ b/tests/components/common/singletontestmocktest.cpp @@ -37,7 +37,7 @@ using std::string; using std::cout; -namespace lumiera +namespace cinelerra { namespace test { @@ -108,8 +108,8 @@ namespace lumiera * @test inject a Mock object into the Singleton Factory, * to be returned and used in place of the original object. * Expected results: Mock(s) called, no memory leaks. - * @see lumiera::Singleton - * @see lumiera::singleton::Static + * @see cinelerra::Singleton + * @see cinelerra::singleton::Static */ class SingletonTestMock_test : public Test { @@ -214,4 +214,4 @@ namespace lumiera } // namespace test -} // namespace lumiera +} // namespace cinelerra diff --git a/tests/components/common/testtargetobj.hpp b/tests/components/common/testtargetobj.hpp index 28ac5890d..8a0728b95 100644 --- a/tests/components/common/testtargetobj.hpp +++ b/tests/components/common/testtargetobj.hpp @@ -21,8 +21,8 @@ */ -#ifndef LUMIERA_TEST_TESTTARGETOBJ_H -#define LUMIERA_TEST_TESTTARGETOBJ_H +#ifndef CINELERRA_TEST_TESTTARGETOBJ_H +#define CINELERRA_TEST_TESTTARGETOBJ_H #include "common/test/run.hpp" @@ -41,7 +41,7 @@ using std::string; using std::cout; -namespace lumiera +namespace cinelerra { namespace test { @@ -107,5 +107,5 @@ namespace lumiera } // namespace test -} // namespace lumiera +} // namespace cinelerra #endif diff --git a/tests/components/common/typelisttest.cpp b/tests/components/common/typelisttest.cpp index 42159d96c..1a2e383e8 100644 --- a/tests/components/common/typelisttest.cpp +++ b/tests/components/common/typelisttest.cpp @@ -30,7 +30,7 @@ using std::string; using std::cout; -namespace lumiera +namespace cinelerra { namespace typelist { @@ -97,4 +97,4 @@ namespace lumiera } // namespace typelist -} // namespace lumiera +} // namespace cinelerra diff --git a/tests/components/common/visitingtoolconcept.cpp b/tests/components/common/visitingtoolconcept.cpp index f2189ed09..16578b6be 100644 --- a/tests/components/common/visitingtoolconcept.cpp +++ b/tests/components/common/visitingtoolconcept.cpp @@ -24,7 +24,7 @@ /** @file visitingtoolconept.cpp ** While laying the foundations for EDL and Builder, Ichthyo came accross ** the necessity to create a custom implementation of the Visitor Pattern - ** optimally suited for Lumiera's needs. This implementation file was + ** optimally suited for Cinelerra's needs. This implementation file was ** used for the draft and is self-contained. The final solution was then ** extracted as library implementation to visitor.hpp ** @@ -60,13 +60,13 @@ #include #include -using lumiera::Singleton; +using cinelerra::Singleton; using boost::format; using std::string; using std::cout; -namespace lumiera +namespace cinelerra { namespace visitor_concept_draft { @@ -459,4 +459,4 @@ namespace lumiera } // namespace visitor_concept_draft -} // namespace lumiera +} // namespace cinelerra diff --git a/tests/components/common/visitingtoolextendedtest.cpp b/tests/components/common/visitingtoolextendedtest.cpp index d29c60b26..a25ebd95a 100644 --- a/tests/components/common/visitingtoolextendedtest.cpp +++ b/tests/components/common/visitingtoolextendedtest.cpp @@ -32,7 +32,7 @@ using std::string; using std::cout; -namespace lumiera +namespace cinelerra { namespace visitor { @@ -226,4 +226,4 @@ namespace lumiera } // namespace visitor -} // namespace lumiera +} // namespace cinelerra diff --git a/tests/components/common/visitingtooltest.cpp b/tests/components/common/visitingtooltest.cpp index 0263d9c88..10edf233d 100644 --- a/tests/components/common/visitingtooltest.cpp +++ b/tests/components/common/visitingtooltest.cpp @@ -32,7 +32,7 @@ using std::string; using std::cout; -namespace lumiera +namespace cinelerra { namespace visitor { @@ -159,4 +159,4 @@ namespace lumiera } // namespace visitor -} // namespace lumiera +} // namespace cinelerra diff --git a/tests/components/helloworldtest.cpp b/tests/components/helloworldtest.cpp index d0c289986..8398f19ad 100644 --- a/tests/components/helloworldtest.cpp +++ b/tests/components/helloworldtest.cpp @@ -31,7 +31,7 @@ using util::isnil; using boost::lexical_cast; -namespace lumiera +namespace cinelerra { namespace test { @@ -65,4 +65,4 @@ namespace lumiera } // namespace test -} // namespace lumiera +} // namespace cinelerra diff --git a/tests/components/mainsuite.cpp b/tests/components/mainsuite.cpp index aa500cdbe..924a982e3 100644 --- a/tests/components/mainsuite.cpp +++ b/tests/components/mainsuite.cpp @@ -1,5 +1,5 @@ /* - mainsuite.cpp - "the" Lumiera self test suite + mainsuite.cpp - "the" cinelerra3 self test suite Copyright (C) Lumiera.org 2008, Christian Thaeter diff --git a/tests/components/proc/asset/createassettest.cpp b/tests/components/proc/asset/createassettest.cpp index d9302fc7c..fa28d4472 100644 --- a/tests/components/proc/asset/createassettest.cpp +++ b/tests/components/proc/asset/createassettest.cpp @@ -100,14 +100,14 @@ namespace asset aMang.getAsset (ID(mm1->getID())); NOTREACHED; } - catch (lumiera::error::Invalid& xxx) {ASSERT (xxx.getID()==LUMIERA_ERROR_WRONG_ASSET_KIND);} + catch (cinelerra::error::Invalid& xxx) {ASSERT (xxx.getID()==CINELERRA_ERROR_WRONG_ASSET_KIND);} try { // try accessing nonexistant ID aMang.getAsset (ID (1234567890)); NOTREACHED; } - catch (lumiera::error::Invalid& xxx) {ASSERT (xxx.getID()==LUMIERA_ERROR_UNKNOWN_ASSET_ID);} - lumiera_error (); // reset errorflag + catch (cinelerra::error::Invalid& xxx) {ASSERT (xxx.getID()==CINELERRA_ERROR_UNKNOWN_ASSET_ID);} + cinelerra_error (); // reset errorflag // checking the Ident-Fields @@ -121,8 +121,8 @@ namespace asset ASSERT (mm3->ident.category == Category (VIDEO )); ASSERT (mm1->ident.org == "ichthyo"); - ASSERT (mm2->ident.org == "lumi"); - ASSERT (mm3->ident.org == "lumi"); + ASSERT (mm2->ident.org == "cin3"); + ASSERT (mm3->ident.org == "cin3"); ASSERT (mm1->ident.version == 5); ASSERT (mm2->ident.version == 1); @@ -159,19 +159,19 @@ namespace asset ASSERT (key2.name == "testfile2"); // name filled in automatically candi = asset::Media::create(string("testfile3.wav"), Category(AUDIO)); - ASSERT ( checkProperties (candi, Asset::Ident("testfile3", Category(AUDIO), "lumi", 1) + ASSERT ( checkProperties (candi, Asset::Ident("testfile3", Category(AUDIO), "cin3", 1) , "testfile3.wav")); candi = asset::Media::create("some/path/testfile4.wav", Category(AUDIO)); - ASSERT ( checkProperties (candi, Asset::Ident("testfile4", Category(AUDIO), "lumi", 1) + ASSERT ( checkProperties (candi, Asset::Ident("testfile4", Category(AUDIO), "cin3", 1) , "some/path/testfile4.wav")); candi = asset::Media::create("", Category(AUDIO,"sub/bin")); - ASSERT ( checkProperties (candi, Asset::Ident("nil", Category(AUDIO,"sub/bin"), "lumi", 1) + ASSERT ( checkProperties (candi, Asset::Ident("nil", Category(AUDIO,"sub/bin"), "cin3", 1) , "")); candi = asset::Media::create("", AUDIO); - ASSERT ( checkProperties (candi, Asset::Ident("nil", Category(AUDIO), "lumi", 1) + ASSERT ( checkProperties (candi, Asset::Ident("nil", Category(AUDIO), "cin3", 1) , "")); } diff --git a/tests/components/proc/asset/mediastructurequerytest.cpp b/tests/components/proc/asset/mediastructurequerytest.cpp index 7cbfcd847..866178fd4 100644 --- a/tests/components/proc/asset/mediastructurequerytest.cpp +++ b/tests/components/proc/asset/mediastructurequerytest.cpp @@ -44,7 +44,7 @@ namespace asset /*********************************************************************** * This test documents the Interface used by MediaFactory when loading - * media files for querying Lumiera's backend layer for information + * media files for querying cinelerra's backend layer for information * on how the media file is structured. */ class MediaStructureQuery_test : public Test diff --git a/tests/components/proc/mobject/controller/rendersegmenttest.cpp b/tests/components/proc/mobject/controller/rendersegmenttest.cpp index a56c76480..fac5568aa 100644 --- a/tests/components/proc/mobject/controller/rendersegmenttest.cpp +++ b/tests/components/proc/mobject/controller/rendersegmenttest.cpp @@ -46,7 +46,7 @@ namespace mobject /******************************************************************* * @test create a render process from a given segment of the EDL. * Basically this includes cooperation of all parts of the - * Lumiera Proc Layer. For a prepared test-EDL we invoke the + * Cinelerra Proc Layer. For a prepared test-EDL we invoke the * controller to create a render process. This includes building * the render pipeline. Finally, we analyze all the created * Structures. diff --git a/tests/components/proc/mobject/placementbasictest.cpp b/tests/components/proc/mobject/placementbasictest.cpp index e3e237252..16b6a80d0 100644 --- a/tests/components/proc/mobject/placementbasictest.cpp +++ b/tests/components/proc/mobject/placementbasictest.cpp @@ -35,7 +35,7 @@ #include //using boost::format; -using lumiera::Time; +using cinelerra::Time; using util::contains; using std::string; using std::cout; diff --git a/tests/components/proc/mobject/session/addcliptest.cpp b/tests/components/proc/mobject/session/addcliptest.cpp index 3cb981270..ffb794e95 100644 --- a/tests/components/proc/mobject/session/addcliptest.cpp +++ b/tests/components/proc/mobject/session/addcliptest.cpp @@ -32,7 +32,7 @@ #include //using boost::format; -using lumiera::Time; +using cinelerra::Time; using util::contains; using std::string; using std::cout; diff --git a/tests/components/proc/mobject/session/testclip.cpp b/tests/components/proc/mobject/session/testclip.cpp index ea17dd19d..ce659e708 100644 --- a/tests/components/proc/mobject/session/testclip.cpp +++ b/tests/components/proc/mobject/session/testclip.cpp @@ -44,7 +44,7 @@ namespace mobject asset::Media & createTestMedia () { - // install Mock-Interface to Lumiera backend + // install Mock-Interface to cinelerra backend MAF::instance.injectSubclass (new MediaAccessMock); PM media = asset::Media::create("test-2", VIDEO); // query magic filename MAF::instance.injectSubclass (0); // remove Mock-Interface @@ -70,7 +70,7 @@ namespace mobject { } }; - lumiera::Singleton testbed_1; // invoke ctor when creating first TestClip... + cinelerra::Singleton testbed_1; // invoke ctor when creating first TestClip... diff --git a/tests/error/errortest.c b/tests/error/errortest.c index d367c0742..0fd95b600 100644 --- a/tests/error/errortest.c +++ b/tests/error/errortest.c @@ -25,7 +25,7 @@ #include "lib/error.h" -LUMIERA_ERROR_DEFINE(TEST, "test error"); +CINELERRA_ERROR_DEFINE(TEST, "test error"); int main (int argc, char** argv) @@ -35,31 +35,31 @@ main (int argc, char** argv) if (!strcmp(argv[1], "set")) { - lumiera_error_set (LUMIERA_ERROR_TEST); + cinelerra_error_set (CINELERRA_ERROR_TEST); } if (!strcmp(argv[1], "get_no")) { const char* err; - err = lumiera_error (); + err = cinelerra_error (); printf ("%p\n", err); } if (!strcmp(argv[1], "get")) { - lumiera_error_set (LUMIERA_ERROR_TEST); + cinelerra_error_set (CINELERRA_ERROR_TEST); const char* err; - err = lumiera_error (); + err = cinelerra_error (); printf ("%s\n", err); } if (!strcmp(argv[1], "get2")) { - lumiera_error_set (LUMIERA_ERROR_TEST); + cinelerra_error_set (CINELERRA_ERROR_TEST); const char* err; - err = lumiera_error (); + err = cinelerra_error (); printf ("%s\n", err); - err = lumiera_error (); + err = cinelerra_error (); printf ("%p\n", err); } diff --git a/tests/library/test-llist.c b/tests/library/test-llist.c index bfaf99c65..bf6c5aed5 100644 --- a/tests/library/test-llist.c +++ b/tests/library/test-llist.c @@ -26,7 +26,7 @@ #include "lib/framerate.h" -LUMIERA_ERROR_DEFINE(TEST, "test error"); +CINELERRA_ERROR_DEFINE(TEST, "test error"); int main (int argc, char** argv) diff --git a/tests/library/test-references.c b/tests/library/test-references.c index c1509c341..f56c7c9d7 100644 --- a/tests/library/test-references.c +++ b/tests/library/test-references.c @@ -25,7 +25,7 @@ #include "lib/references.h" -LUMIERA_ERROR_DEFINE(TEST, "test error"); +CINELERRA_ERROR_DEFINE(TEST, "test error"); struct example @@ -55,16 +55,16 @@ main (int argc, char** argv) struct example test; test.foo = 123; - lumiera_reference hold; + cinelerra_reference hold; - lumiera_reference_strong_init_once (&hold, &test, example_dtor); + cinelerra_reference_strong_init_once (&hold, &test, example_dtor); - struct example* r = lumiera_reference_get (&hold); + struct example* r = cinelerra_reference_get (&hold); printf ("got: %d\n", r->foo); - lumiera_reference_destroy (&hold); + cinelerra_reference_destroy (&hold); } else if (!strcmp(argv[1], "nodeinsert")) { diff --git a/tests/locking/condition.c b/tests/locking/condition.c index 7d79e9a7e..6483ac0a9 100644 --- a/tests/locking/condition.c +++ b/tests/locking/condition.c @@ -40,10 +40,10 @@ signaling_thread() int conditionforgotunlock () { - lumiera_condition c; - lumiera_condition_init (&c); + cinelerra_condition c; + cinelerra_condition_init (&c); - lumiera_conditionacquirer l; - lumiera_conditionacquirer_init (&l, &c, LUMIERA_LOCKED); + cinelerra_conditionacquirer l; + cinelerra_conditionacquirer_init (&l, &c, CINELERRA_LOCKED); return 0; } diff --git a/tests/locking/mutex.c b/tests/locking/mutex.c index f4f8c18f6..ed6a050eb 100644 --- a/tests/locking/mutex.c +++ b/tests/locking/mutex.c @@ -23,10 +23,10 @@ int mutexforgotunlock() { - lumiera_mutex m; - lumiera_mutex_init (&m); + cinelerra_mutex m; + cinelerra_mutex_init (&m); - lumiera_mutexacquirer l; - lumiera_mutexacquirer_init_mutex (&l, &m, LUMIERA_LOCKED); + cinelerra_mutexacquirer l; + cinelerra_mutexacquirer_init_mutex (&l, &m, CINELERRA_LOCKED); return 0; } diff --git a/tests/locking/test-condition.c b/tests/locking/test-condition.c index 1e3ca1bf7..cc8e5ae14 100644 --- a/tests/locking/test-condition.c +++ b/tests/locking/test-condition.c @@ -24,7 +24,7 @@ #include "lib/condition.h" -LUMIERA_ERROR_DEFINE(TEST, "test error"); +CINELERRA_ERROR_DEFINE(TEST, "test error"); #if 0 waiting_thread() @@ -52,11 +52,11 @@ main (int argc, char** argv) if (!strcmp(argv[1], "conditionforgotunlock")) { - lumiera_condition c; - lumiera_condition_init (&c); + cinelerra_condition c; + cinelerra_condition_init (&c); - lumiera_conditionlock NOBUG_CLEANUP(lumiera_conditionlock_ensureunlocked) l; - lumiera_conditionlock_init (&l, &c, LUMIERA_LOCKED); + cinelerra_conditionlock NOBUG_CLEANUP(cinelerra_conditionlock_ensureunlocked) l; + cinelerra_conditionlock_init (&l, &c, CINELERRA_LOCKED); } else return 1; diff --git a/tests/locking/test-locking.c b/tests/locking/test-locking.c index 1b54d152e..46455764b 100644 --- a/tests/locking/test-locking.c +++ b/tests/locking/test-locking.c @@ -24,7 +24,7 @@ #include "lib/error.h" -LUMIERA_ERROR_DEFINE(TEST, "test error"); +CINELERRA_ERROR_DEFINE(TEST, "test error"); int conditionforgotunlock (); int mutexforgotunlock (); diff --git a/tests/plugin/example_plugin.c b/tests/plugin/example_plugin.c index 7540aa35d..ebb71ae8a 100644 --- a/tests/plugin/example_plugin.c +++ b/tests/plugin/example_plugin.c @@ -34,12 +34,12 @@ void bye(const char* m) printf("Bye %s\n", m); } -LUMIERA_INTERFACE_IMPLEMENT(hello, 1, german, myopen, myclose, - hallo, - tschuess - ); +CINELERRA_INTERFACE_IMPLEMENT(hello, 1, german, myopen, myclose, + hallo, + tschuess + ); -LUMIERA_INTERFACE_IMPLEMENT(hello, 1, english, myopen, myclose, - hello, - bye - ); +CINELERRA_INTERFACE_IMPLEMENT(hello, 1, english, myopen, myclose, + hello, + bye + ); diff --git a/tests/plugin/example_plugin.cpp b/tests/plugin/example_plugin.cpp index aba34b44a..b608887d8 100644 --- a/tests/plugin/example_plugin.cpp +++ b/tests/plugin/example_plugin.cpp @@ -50,12 +50,12 @@ public: }; -LUMIERA_INTERFACE_IMPLEMENT(hello, 1, german, example_plugin_de::myopen, example_plugin_de::myclose, - example_plugin_de::hello, - example_plugin_de::bye - ); +CINELERRA_INTERFACE_IMPLEMENT(hello, 1, german, example_plugin_de::myopen, example_plugin_de::myclose, + example_plugin_de::hello, + example_plugin_de::bye + ); -LUMIERA_INTERFACE_IMPLEMENT(hello, 1, english, example_plugin_en::myopen, example_plugin_en::myclose, - example_plugin_en::hello, - example_plugin_en::bye - ); +CINELERRA_INTERFACE_IMPLEMENT(hello, 1, english, example_plugin_en::myopen, example_plugin_en::myclose, + example_plugin_en::hello, + example_plugin_en::bye + ); diff --git a/tests/plugin/hello_interface.h b/tests/plugin/hello_interface.h index d5cf99ea5..ccec270ed 100644 --- a/tests/plugin/hello_interface.h +++ b/tests/plugin/hello_interface.h @@ -1,6 +1,6 @@ #include "lib/plugin.h" -LUMIERA_INTERFACE(hello, 1, - LUMIERA_INTERFACE_PROTO(void, hello, (void)) - LUMIERA_INTERFACE_PROTO(void, goodbye, (const char*)) - ); +CINELERRA_INTERFACE(hello, 1, + CINELERRA_INTERFACE_PROTO(void, hello, (void)) + CINELERRA_INTERFACE_PROTO(void, goodbye, (const char*)) + ); diff --git a/tests/plugin/plugin_main.c b/tests/plugin/plugin_main.c index 2efe32471..e691438b3 100644 --- a/tests/plugin/plugin_main.c +++ b/tests/plugin/plugin_main.c @@ -12,7 +12,7 @@ main(int argc, char** argv) if (argc < 2) return -1; - lumiera_init_plugin (); + cinelerra_init_plugin (); /* we have a plugin 'hello_1' which provides us 2 hello interfaces, one for english and one for german output, open both try them, close them. @@ -22,47 +22,47 @@ main(int argc, char** argv) if( !strcmp(argv[1],"C")) { - LUMIERA_INTERFACE_TYPE(hello, 1)* hello_de = - (LUMIERA_INTERFACE_TYPE(hello, 1)*) lumiera_interface_open ("example_plugin", "german_1", sizeof(LUMIERA_INTERFACE_TYPE(hello, 1))); + CINELERRA_INTERFACE_TYPE(hello, 1)* hello_de = + (CINELERRA_INTERFACE_TYPE(hello, 1)*) cinelerra_interface_open ("example_plugin", "german_1", sizeof(CINELERRA_INTERFACE_TYPE(hello, 1))); - if (!hello_de) LUMIERA_DIE; + if (!hello_de) CINELERRA_DIE; hello_de->hello(); hello_de->goodbye(argv[1]); - LUMIERA_INTERFACE_TYPE(hello, 1)* hello_en = - (LUMIERA_INTERFACE_TYPE(hello, 1)*) lumiera_interface_open ("example_plugin", "english_1", sizeof(LUMIERA_INTERFACE_TYPE(hello, 1))); + CINELERRA_INTERFACE_TYPE(hello, 1)* hello_en = + (CINELERRA_INTERFACE_TYPE(hello, 1)*) cinelerra_interface_open ("example_plugin", "english_1", sizeof(CINELERRA_INTERFACE_TYPE(hello, 1))); - if (!hello_en) LUMIERA_DIE; + if (!hello_en) CINELERRA_DIE; hello_en->hello(); hello_en->goodbye(argv[1]); - lumiera_interface_close (hello_en); - lumiera_interface_close (hello_de); + cinelerra_interface_close (hello_en); + cinelerra_interface_close (hello_de); } if( !strcmp(argv[1],"C++")) { /* same again for a plugin written in C++ */ - LUMIERA_INTERFACE_TYPE(hello, 1)* hello_de = - (LUMIERA_INTERFACE_TYPE(hello, 1)*) lumiera_interface_open ("example_plugin_cpp", "german_1", sizeof(LUMIERA_INTERFACE_TYPE(hello, 1))); + CINELERRA_INTERFACE_TYPE(hello, 1)* hello_de = + (CINELERRA_INTERFACE_TYPE(hello, 1)*) cinelerra_interface_open ("example_plugin_cpp", "german_1", sizeof(CINELERRA_INTERFACE_TYPE(hello, 1))); - if (!hello_de) LUMIERA_DIE; + if (!hello_de) CINELERRA_DIE; hello_de->hello(); hello_de->goodbye(argv[1]); - LUMIERA_INTERFACE_TYPE(hello, 1)* hello_en = - (LUMIERA_INTERFACE_TYPE(hello, 1)*) lumiera_interface_open ("example_plugin_cpp", "english_1", sizeof(LUMIERA_INTERFACE_TYPE(hello, 1))); + CINELERRA_INTERFACE_TYPE(hello, 1)* hello_en = + (CINELERRA_INTERFACE_TYPE(hello, 1)*) cinelerra_interface_open ("example_plugin_cpp", "english_1", sizeof(CINELERRA_INTERFACE_TYPE(hello, 1))); - if (!hello_en) LUMIERA_DIE; + if (!hello_en) CINELERRA_DIE; hello_en->hello(); hello_en->goodbye(argv[1]); - lumiera_interface_close (hello_en); - lumiera_interface_close (hello_de); + cinelerra_interface_close (hello_en); + cinelerra_interface_close (hello_de); } return 0; diff --git a/tests/time/test-time.c b/tests/time/test-time.c index e9d8d0550..01dd107ef 100644 --- a/tests/time/test-time.c +++ b/tests/time/test-time.c @@ -26,7 +26,7 @@ #include "lib/framerate.h" -LUMIERA_ERROR_DEFINE(TEST, "test error"); +CINELERRA_ERROR_DEFINE(TEST, "test error"); int main (int argc, char** argv) @@ -38,106 +38,106 @@ main (int argc, char** argv) if (!strcmp(argv[1], "init")) { - lumiera_time time; + cinelerra_time time; - lumiera_time_init (&time, atol (argv[2]), atol(argv[3])); + cinelerra_time_init (&time, atol (argv[2]), atol(argv[3])); - printf ("%lu %lu\n", (long)lumiera_time_sec (&time), (long)lumiera_time_usec (&time)); + printf ("%lu %lu\n", (long)cinelerra_time_sec (&time), (long)cinelerra_time_usec (&time)); } if (!strcmp(argv[1], "todouble")) { - lumiera_time time; + cinelerra_time time; - lumiera_time_init (&time, atol (argv[2]), atol(argv[3])); + cinelerra_time_init (&time, atol (argv[2]), atol(argv[3])); - printf ("%g\n", lumiera_time_double_get (&time)); + printf ("%g\n", cinelerra_time_double_get (&time)); } if (!strcmp(argv[1], "todoublenull")) { - printf ("%g\n", lumiera_time_double_get (NULL)); + printf ("%g\n", cinelerra_time_double_get (NULL)); } if (!strcmp(argv[1], "fromdouble")) { - lumiera_time time; + cinelerra_time time; - lumiera_time_set_double (&time, atof (argv[2])); + cinelerra_time_set_double (&time, atof (argv[2])); - printf ("%lu %lu\n", (long)lumiera_time_sec (&time), (long)lumiera_time_usec (&time)); + printf ("%lu %lu\n", (long)cinelerra_time_sec (&time), (long)cinelerra_time_usec (&time)); } if (!strcmp(argv[1], "currenttime")) { - lumiera_time time; + cinelerra_time time; - lumiera_time_current (&time); + cinelerra_time_current (&time); - printf ("%lu %lu\n", (long)lumiera_time_sec (&time), (long)lumiera_time_usec (&time)); + printf ("%lu %lu\n", (long)cinelerra_time_sec (&time), (long)cinelerra_time_usec (&time)); } if (!strcmp(argv[1], "add")) { - lumiera_time time1, time2; + cinelerra_time time1, time2; - lumiera_time_init (&time1, 0, atol (argv[2])); - lumiera_time_init (&time2, 0, atol (argv[3])); - lumiera_time_add (&time1, &time2); + cinelerra_time_init (&time1, 0, atol (argv[2])); + cinelerra_time_init (&time2, 0, atol (argv[3])); + cinelerra_time_add (&time1, &time2); - printf ("%lu %lu\n", (long)lumiera_time_sec (&time1), (long)lumiera_time_usec (&time1)); + printf ("%lu %lu\n", (long)cinelerra_time_sec (&time1), (long)cinelerra_time_usec (&time1)); } if (!strcmp(argv[1], "sub")) { - lumiera_time time1, time2; + cinelerra_time time1, time2; - lumiera_time_init (&time1, 0, atol (argv[2])); - lumiera_time_init (&time2, 0, atol (argv[3])); - lumiera_time_sub (&time1, &time2); + cinelerra_time_init (&time1, 0, atol (argv[2])); + cinelerra_time_init (&time2, 0, atol (argv[3])); + cinelerra_time_sub (&time1, &time2); - printf ("%lu %lu\n", (long)lumiera_time_sec (&time1), (long)lumiera_time_usec (&time1)); + printf ("%lu %lu\n", (long)cinelerra_time_sec (&time1), (long)cinelerra_time_usec (&time1)); } if (!strcmp(argv[1], "ntscframefromtime")) { - lumiera_framerate ntsc = {30000, 1001}; - lumiera_time time; + cinelerra_framerate ntsc = {30000, 1001}; + cinelerra_time time; - lumiera_time_init (&time, atol (argv[2]), atol (argv[3])); + cinelerra_time_init (&time, atol (argv[2]), atol (argv[3])); - printf ("%lu\n", (long)lumiera_framerate_frame_get_time (&ntsc, &time)); + printf ("%lu\n", (long)cinelerra_framerate_frame_get_time (&ntsc, &time)); } if (!strcmp(argv[1], "ntscframestart")) { - lumiera_framerate ntsc = {30000, 1001}; - lumiera_time time; + cinelerra_framerate ntsc = {30000, 1001}; + cinelerra_time time; - if(lumiera_framerate_time_get_time_frame (&ntsc, &time, atol (argv[2]))) - printf ("%lu %lu\n", (long)lumiera_time_sec(&time), (long)lumiera_time_usec(&time)); + if(cinelerra_framerate_time_get_time_frame (&ntsc, &time, atol (argv[2]))) + printf ("%lu %lu\n", (long)cinelerra_time_sec(&time), (long)cinelerra_time_usec(&time)); } if (!strcmp(argv[1], "ntscframecheck")) { - lumiera_framerate ntsc = {30000, 1001}; - lumiera_time time1; - lumiera_time time2; - lumiera_framepos frame; + cinelerra_framerate ntsc = {30000, 1001}; + cinelerra_time time1; + cinelerra_time time2; + cinelerra_framepos frame; - lumiera_framepos frame1; - lumiera_framepos frame2; + cinelerra_framepos frame1; + cinelerra_framepos frame2; frame = atol (argv[2]); - if (lumiera_framerate_time_get_time_frame (&ntsc, &time1, frame)) + if (cinelerra_framerate_time_get_time_frame (&ntsc, &time1, frame)) { - printf("frame %lu ", frame1 = lumiera_framerate_frame_get_time (&ntsc, &time1)); + printf("frame %lu ", frame1 = cinelerra_framerate_frame_get_time (&ntsc, &time1)); - lumiera_time_init (&time2, 0, 1); - lumiera_time_sub (&time1, &time2); - printf("%lu\n", frame2 = lumiera_framerate_frame_get_time (&ntsc, &time1)); + cinelerra_time_init (&time2, 0, 1); + cinelerra_time_sub (&time1, &time2); + printf("%lu\n", frame2 = cinelerra_framerate_frame_get_time (&ntsc, &time1)); ENSURE (frame1 == frame2+1); } From 7721b6f5b1a9edf3181852c0eeec18df5dc3e18a Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Tue, 8 Apr 2008 23:21:05 +0100 Subject: [PATCH 002/110] Created initial UI base --- gui/AUTHORS | 0 gui/COPYING | 1 + gui/ChangeLog | 0 gui/INSTALL | 1 + gui/Makefile.am | 24 ++++++ gui/NEWS | 0 gui/README | 0 gui/TODO.tasks | 6 ++ gui/autogen.sh | 159 ++++++++++++++++++++++++++++++++++++++ gui/config.h | 77 ++++++++++++++++++ gui/configure.ac | 44 +++++++++++ gui/gtk-lumiera.anjuta | 44 +++++++++++ gui/po/ChangeLog | 0 gui/po/LINGUAS | 2 + gui/po/POTFILES.in | 3 + gui/src/Makefile.am | 27 +++++++ gui/src/gtk-lumiera.glade | 27 +++++++ gui/src/main.cpp | 62 +++++++++++++++ 18 files changed, 477 insertions(+) create mode 100644 gui/AUTHORS create mode 120000 gui/COPYING create mode 100644 gui/ChangeLog create mode 120000 gui/INSTALL create mode 100644 gui/Makefile.am create mode 100644 gui/NEWS create mode 100644 gui/README create mode 100644 gui/TODO.tasks create mode 100755 gui/autogen.sh create mode 100644 gui/config.h create mode 100644 gui/configure.ac create mode 100644 gui/gtk-lumiera.anjuta create mode 100644 gui/po/ChangeLog create mode 100644 gui/po/LINGUAS create mode 100644 gui/po/POTFILES.in create mode 100644 gui/src/Makefile.am create mode 100644 gui/src/gtk-lumiera.glade create mode 100644 gui/src/main.cpp diff --git a/gui/AUTHORS b/gui/AUTHORS new file mode 100644 index 000000000..e69de29bb diff --git a/gui/COPYING b/gui/COPYING new file mode 120000 index 000000000..0b6cbf81b --- /dev/null +++ b/gui/COPYING @@ -0,0 +1 @@ +/usr/share/automake-1.10/COPYING \ No newline at end of file diff --git a/gui/ChangeLog b/gui/ChangeLog new file mode 100644 index 000000000..e69de29bb diff --git a/gui/INSTALL b/gui/INSTALL new file mode 120000 index 000000000..5bb6e7b7e --- /dev/null +++ b/gui/INSTALL @@ -0,0 +1 @@ +/usr/share/automake-1.10/INSTALL \ No newline at end of file diff --git a/gui/Makefile.am b/gui/Makefile.am new file mode 100644 index 000000000..329e83f38 --- /dev/null +++ b/gui/Makefile.am @@ -0,0 +1,24 @@ +## Process this file with automake to produce Makefile.in +## Created by Anjuta + +SUBDIRS = src po + +gtk_lumieradocdir = ${prefix}/doc/gtk-lumiera +gtk_lumieradoc_DATA = \ + README\ + COPYING\ + AUTHORS\ + ChangeLog\ + INSTALL\ + NEWS + +EXTRA_DIST = $(gtk_lumieradoc_DATA) + +# Copy all the spec files. Of cource, only one is actually used. +dist-hook: + for specfile in *.spec; do \ + if test -f $$specfile; then \ + cp -p $$specfile $(distdir); \ + fi \ + done + diff --git a/gui/NEWS b/gui/NEWS new file mode 100644 index 000000000..e69de29bb diff --git a/gui/README b/gui/README new file mode 100644 index 000000000..e69de29bb diff --git a/gui/TODO.tasks b/gui/TODO.tasks new file mode 100644 index 000000000..d1fa282d9 --- /dev/null +++ b/gui/TODO.tasks @@ -0,0 +1,6 @@ + + + + + + diff --git a/gui/autogen.sh b/gui/autogen.sh new file mode 100755 index 000000000..9ab346a30 --- /dev/null +++ b/gui/autogen.sh @@ -0,0 +1,159 @@ +#!/bin/sh +# Run this to generate all the initial makefiles, etc. + +srcdir=`dirname $0` +test -z "$srcdir" && srcdir=. + +DIE=0 + +if [ -n "$GNOME2_DIR" ]; then + ACLOCAL_FLAGS="-I $GNOME2_DIR/share/aclocal $ACLOCAL_FLAGS" + LD_LIBRARY_PATH="$GNOME2_DIR/lib:$LD_LIBRARY_PATH" + PATH="$GNOME2_DIR/bin:$PATH" + export PATH + export LD_LIBRARY_PATH +fi + +(test -f $srcdir/configure.ac) || { + echo -n "**Error**: Directory "\`$srcdir\'" does not look like the" + echo " top-level package directory" + exit 1 +} + +(autoconf --version) < /dev/null > /dev/null 2>&1 || { + echo + echo "**Error**: You must have \`autoconf' installed." + echo "Download the appropriate package for your distribution," + echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" + DIE=1 +} + +(grep "^IT_PROG_INTLTOOL" $srcdir/configure.ac >/dev/null) && { + (intltoolize --version) < /dev/null > /dev/null 2>&1 || { + echo + echo "**Error**: You must have \`intltool' installed." + echo "You can get it from:" + echo " ftp://ftp.gnome.org/pub/GNOME/" + DIE=1 + } +} + +(grep "^AM_PROG_XML_I18N_TOOLS" $srcdir/configure.ac >/dev/null) && { + (xml-i18n-toolize --version) < /dev/null > /dev/null 2>&1 || { + echo + echo "**Error**: You must have \`xml-i18n-toolize' installed." + echo "You can get it from:" + echo " ftp://ftp.gnome.org/pub/GNOME/" + DIE=1 + } +} + +(grep "^AM_PROG_LIBTOOL" $srcdir/configure.ac >/dev/null) && { + (libtool --version) < /dev/null > /dev/null 2>&1 || { + echo + echo "**Error**: You must have \`libtool' installed." + echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/" + DIE=1 + } +} + +(grep "^AM_GLIB_GNU_GETTEXT" $srcdir/configure.ac >/dev/null) && { + (grep "sed.*POTFILES" $srcdir/configure.ac) > /dev/null || \ + (glib-gettextize --version) < /dev/null > /dev/null 2>&1 || { + echo + echo "**Error**: You must have \`glib' installed." + echo "You can get it from: ftp://ftp.gtk.org/pub/gtk" + DIE=1 + } +} + +(automake --version) < /dev/null > /dev/null 2>&1 || { + echo + echo "**Error**: You must have \`automake' installed." + echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/" + DIE=1 + NO_AUTOMAKE=yes +} + + +# if no automake, don't bother testing for aclocal +test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || { + echo + echo "**Error**: Missing \`aclocal'. The version of \`automake'" + echo "installed doesn't appear recent enough." + echo "You can get automake from ftp://ftp.gnu.org/pub/gnu/" + DIE=1 +} + +if test "$DIE" -eq 1; then + exit 1 +fi + +if test -z "$*"; then + echo "**Warning**: I am going to run \`configure' with no arguments." + echo "If you wish to pass any to it, please specify them on the" + echo \`$0\'" command line." + echo +fi + +case $CC in +xlc ) + am_opt=--include-deps;; +esac + +for coin in `find $srcdir -path $srcdir/CVS -prune -o -name configure.ac -print` +do + dr=`dirname $coin` + if test -f $dr/NO-AUTO-GEN; then + echo skipping $dr -- flagged as no auto-gen + else + echo processing $dr + ( cd $dr + + aclocalinclude="$ACLOCAL_FLAGS" + + if grep "^AM_GLIB_GNU_GETTEXT" configure.ac >/dev/null; then + echo "Creating $dr/aclocal.m4 ..." + test -r $dr/aclocal.m4 || touch $dr/aclocal.m4 + echo "Running glib-gettextize... Ignore non-fatal messages." + echo "no" | glib-gettextize --force --copy + echo "Making $dr/aclocal.m4 writable ..." + test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4 + fi + if grep "^IT_PROG_INTLTOOL" configure.ac >/dev/null; then + echo "Running intltoolize..." + intltoolize --copy --force --automake + fi + if grep "^AM_PROG_XML_I18N_TOOLS" configure.ac >/dev/null; then + echo "Running xml-i18n-toolize..." + xml-i18n-toolize --copy --force --automake + fi + if grep "^AM_PROG_LIBTOOL" configure.ac >/dev/null; then + if test -z "$NO_LIBTOOLIZE" ; then + echo "Running libtoolize..." + libtoolize --force --copy + fi + fi + echo "Running aclocal $aclocalinclude ..." + aclocal $aclocalinclude + if grep "^AM_CONFIG_HEADER" configure.ac >/dev/null; then + echo "Running autoheader..." + autoheader + fi + echo "Running automake --gnu $am_opt ..." + automake --add-missing --gnu $am_opt + echo "Running autoconf ..." + autoconf + ) + fi +done + +conf_flags="--enable-maintainer-mode" + +if test x$NOCONFIGURE = x; then + echo Running $srcdir/configure $conf_flags "$@" ... + $srcdir/configure $conf_flags "$@" \ + && echo Now type \`make\' to compile. || exit 1 +else + echo Skipping configure process. +fi diff --git a/gui/config.h b/gui/config.h new file mode 100644 index 000000000..7b9564f69 --- /dev/null +++ b/gui/config.h @@ -0,0 +1,77 @@ +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* always defined to indicate that i18n is enabled */ +#define ENABLE_NLS 1 + +/* GETTEXT package name */ +#define GETTEXT_PACKAGE "gtk-lumiera" + +/* Define to 1 if you have the `bind_textdomain_codeset' function. */ +#define HAVE_BIND_TEXTDOMAIN_CODESET 1 + +/* Define to 1 if you have the `dcgettext' function. */ +#define HAVE_DCGETTEXT 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define if the GNU gettext() function is already present or preinstalled. */ +#define HAVE_GETTEXT 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define if your file defines LC_MESSAGES. */ +#define HAVE_LC_MESSAGES 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LOCALE_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Name of package */ +#define PACKAGE "gtk-lumiera" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "gtk-lumiera" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "gtk-lumiera 0.1" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "gtk-lumiera" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "0.1" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Version number of package */ +#define VERSION "0.1" diff --git a/gui/configure.ac b/gui/configure.ac new file mode 100644 index 000000000..9eef896f8 --- /dev/null +++ b/gui/configure.ac @@ -0,0 +1,44 @@ +dnl Process this file with autoconf to produce a configure script. +dnl Created by Anjuta application wizard. + +AC_INIT(gtk-lumiera, 0.1) + +AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) +AM_CONFIG_HEADER(config.h) +AM_MAINTAINER_MODE + +AC_ISC_POSIX +AC_PROG_CXX +AM_PROG_CC_STDC +AC_HEADER_STDC + + + + +dnl *************************************************************************** +dnl Internatinalization +dnl *************************************************************************** +GETTEXT_PACKAGE=gtk-lumiera +AC_SUBST(GETTEXT_PACKAGE) +AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [GETTEXT package name]) +AM_GLIB_GNU_GETTEXT +IT_PROG_INTLTOOL([0.35.0]) + + + +AM_PROG_LIBTOOL + + + +PKG_CHECK_MODULES(GTK_LUMIERA, [gtkmm-2.4 >= 2.8 libglademm-2.4 >= 2.6 ]) +AC_SUBST(GTK_LUMIERA_CFLAGS) +AC_SUBST(GTK_LUMIERA_LIBS) + + + + +AC_OUTPUT([ +Makefile +src/Makefile +po/Makefile.in +]) diff --git a/gui/gtk-lumiera.anjuta b/gui/gtk-lumiera.anjuta new file mode 100644 index 000000000..8b9268a44 --- /dev/null +++ b/gui/gtk-lumiera.anjuta @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/gui/po/ChangeLog b/gui/po/ChangeLog new file mode 100644 index 000000000..e69de29bb diff --git a/gui/po/LINGUAS b/gui/po/LINGUAS new file mode 100644 index 000000000..bc8cbb0fe --- /dev/null +++ b/gui/po/LINGUAS @@ -0,0 +1,2 @@ +# please keep this list sorted alphabetically +# diff --git a/gui/po/POTFILES.in b/gui/po/POTFILES.in new file mode 100644 index 000000000..a0b3c552e --- /dev/null +++ b/gui/po/POTFILES.in @@ -0,0 +1,3 @@ +# List of source files containing translatable strings. + +src/main.c diff --git a/gui/src/Makefile.am b/gui/src/Makefile.am new file mode 100644 index 000000000..7ae61d803 --- /dev/null +++ b/gui/src/Makefile.am @@ -0,0 +1,27 @@ +## Process this file with automake to produce Makefile.in + +## Created by Anjuta + +gladedir = $(datadir)/gtk-lumiera/glade +glade_DATA = gtk-lumiera.glade + +INCLUDES = \ + -DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \ + -DPACKAGE_SRC_DIR=\""$(srcdir)"\" \ + -DPACKAGE_DATA_DIR=\""$(datadir)"\" \ + $(GTK_LUMIERA_CFLAGS) + +AM_CFLAGS =\ + -Wall\ + -g + +bin_PROGRAMS = gtk-lumiera + +gtk_lumiera_SOURCES = \ + main.cpp + +gtk_lumiera_LDFLAGS = + +gtk_lumiera_LDADD = $(GTK_LUMIERA_LIBS) + +EXTRA_DIST = $(glade_DATA) diff --git a/gui/src/gtk-lumiera.glade b/gui/src/gtk-lumiera.glade new file mode 100644 index 000000000..8db3bef2c --- /dev/null +++ b/gui/src/gtk-lumiera.glade @@ -0,0 +1,27 @@ + + + + + + + True + Hello World! + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + 500 + 400 + True + False + True + False + False + GDK_WINDOW_TYPE_HINT_NORMAL + GDK_GRAVITY_NORTH_WEST + + + + + + + diff --git a/gui/src/main.cpp b/gui/src/main.cpp new file mode 100644 index 000000000..bb69eb3d9 --- /dev/null +++ b/gui/src/main.cpp @@ -0,0 +1,62 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */ +/* + * main.cc + * Copyright (C) Joel Holdsworth 2008 + * + * main.cc is free software. + * + * You may 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. + * + * main.cc 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 main.cc. If not, write to: + * The Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor + * Boston, MA 02110-1301, USA. + */ + +#include +#include +#include + + +#ifdef ENABLE_NLS +# include +#endif + + +/* For testing propose use the local (not installed) glade file */ +/* #define GLADE_FILE PACKAGE_DATA_DIR"/gtk-lumiera/glade/gtk-lumiera.glade" */ +#define GLADE_FILE "gtk-lumiera.glade" + +int +main (int argc, char *argv[]) +{ + Gtk::Main kit(argc, argv); + + //Load the Glade file and instiate its widgets: + Glib::RefPtr refXml; + try + { + refXml = Gnome::Glade::Xml::create(GLADE_FILE); + } + catch(const Gnome::Glade::XmlError& ex) + { + std::cerr << ex.what() << std::endl; + return 1; + } + Gtk::Window* main_win = 0; + refXml->get_widget("main_window", main_win); + if (main_win) + { + kit.run(*main_win); + } + return 0; +} From 69a06cdc2d89bd39ef23057fba3f5de51ee241b4 Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Tue, 8 Apr 2008 23:27:21 +0100 Subject: [PATCH 003/110] Revert "Revert "Lumiera renaming -- source code"" This reverts commit e9a8b9f64d2b3ccf4887e8b75a19d1e291c249c7. --- src/backend/mediaaccessfacade.cpp | 4 +- src/backend/mediaaccessfacade.hpp | 2 +- src/common/appconfig.cpp | 10 +- src/common/appconfig.hpp | 8 +- src/common/error.cpp | 38 ++-- src/common/error.hpp | 84 ++++----- src/common/factory.hpp | 8 +- src/common/multithread.hpp | 12 +- src/common/singleton.hpp | 6 +- src/common/singletonfactory.hpp | 8 +- src/common/singletonpolicies.hpp | 14 +- src/common/singletonpreconfigure.hpp | 18 +- src/common/test/mockinjector.hpp | 8 +- src/common/test/suite.cpp | 6 +- src/common/time.cpp | 4 +- src/common/time.hpp | 8 +- src/common/typelist.hpp | 10 +- src/common/visitor.cpp | 4 +- src/common/visitor.hpp | 10 +- src/common/visitordispatcher.hpp | 8 +- src/common/visitorpolicies.hpp | 12 +- src/lib/condition.c | 12 +- src/lib/condition.h | 86 ++++----- src/lib/error.c | 32 ++-- src/lib/error.h | 38 ++-- src/lib/framerate.c | 4 +- src/lib/framerate.h | 42 ++--- src/lib/locking.h | 14 +- src/lib/mutex.c | 10 +- src/lib/mutex.h | 90 +++++----- src/lib/plugin.c | 164 +++++++++--------- src/lib/plugin.h | 74 ++++---- src/lib/references.c | 70 ++++---- src/lib/references.h | 52 +++--- src/lib/rwlock.c | 62 +++---- src/lib/rwlock.h | 60 +++---- src/lib/time.c | 6 +- src/lib/time.h | 66 +++---- src/{cinelerra.h => lumiera.h} | 12 +- src/main.cpp | 4 +- src/nobugcfg.h | 2 +- src/plugin/helloplugin.c | 4 +- src/pre.hpp | 8 +- src/proc/asset.cpp | 2 +- src/proc/asset.hpp | 4 +- src/proc/asset/db.hpp | 4 +- src/proc/asset/media.cpp | 22 +-- src/proc/asset/media.hpp | 8 +- src/proc/asset/meta.hpp | 2 +- src/proc/asset/proc.hpp | 2 +- src/proc/asset/struct.hpp | 2 +- src/proc/asset/unknown.cpp | 16 +- src/proc/asset/unknown.hpp | 6 +- src/proc/assetmanager.cpp | 30 ++-- src/proc/assetmanager.hpp | 12 +- src/proc/engine/codecadapter.hpp | 2 +- src/proc/engine/pluginadapter.hpp | 2 +- src/proc/engine/processor.hpp | 6 +- src/proc/mobject/builder/buildertool.hpp | 8 +- src/proc/mobject/mobject.hpp | 6 +- src/proc/mobject/placement.hpp | 2 +- src/proc/mobject/session.hpp | 2 +- src/proc/mobject/session/locatingpin.hpp | 4 +- src/proc/mobject/session/segment.hpp | 4 +- src/proc/mobject/session/session.cpp | 2 +- src/proc/mobject/session/sessionimpl.cpp | 2 +- src/proc/mobject/session/sessionimpl.hpp | 2 +- src/tool/hello.c | 4 +- tests/10errorhandling.tests | 4 +- tests/50components.tests | 20 +-- tests/54builder.tests | 2 +- tests/components/backend/mediaaccessmock.cpp | 2 +- tests/components/backend/mediaaccessmock.hpp | 2 +- tests/components/common/appconfigtest.cpp | 6 +- .../components/common/exceptionerrortest.cpp | 38 ++-- .../components/common/factoryspecialtest.cpp | 4 +- tests/components/common/factorytest.cpp | 6 +- tests/components/common/singletontest.cpp | 10 +- .../common/singletontestmocktest.cpp | 8 +- tests/components/common/testtargetobj.hpp | 8 +- tests/components/common/typelisttest.cpp | 4 +- .../components/common/visitingtoolconcept.cpp | 8 +- .../common/visitingtoolextendedtest.cpp | 4 +- tests/components/common/visitingtooltest.cpp | 4 +- tests/components/helloworldtest.cpp | 4 +- tests/components/mainsuite.cpp | 2 +- .../components/proc/asset/createassettest.cpp | 18 +- .../proc/asset/mediastructurequerytest.cpp | 2 +- .../mobject/controller/rendersegmenttest.cpp | 2 +- .../proc/mobject/placementbasictest.cpp | 2 +- .../proc/mobject/session/addcliptest.cpp | 2 +- .../proc/mobject/session/testclip.cpp | 4 +- tests/error/errortest.c | 16 +- tests/library/test-llist.c | 2 +- tests/library/test-references.c | 10 +- tests/locking/condition.c | 8 +- tests/locking/mutex.c | 8 +- tests/locking/test-condition.c | 10 +- tests/locking/test-locking.c | 2 +- tests/plugin/example_plugin.c | 16 +- tests/plugin/example_plugin.cpp | 16 +- tests/plugin/hello_interface.h | 8 +- tests/plugin/plugin_main.c | 34 ++-- tests/time/test-time.c | 86 ++++----- 104 files changed, 866 insertions(+), 866 deletions(-) rename src/{cinelerra.h => lumiera.h} (90%) diff --git a/src/backend/mediaaccessfacade.cpp b/src/backend/mediaaccessfacade.cpp index bd12068f9..ad52698b8 100644 --- a/src/backend/mediaaccessfacade.cpp +++ b/src/backend/mediaaccessfacade.cpp @@ -26,13 +26,13 @@ #include "common/util.hpp" using util::isnil; -using cinelerra::error::Invalid; +using lumiera::error::Invalid; namespace backend_interface { /** storage for the SingletonFactory - * (actually a cinelerra::test::MockInjector) */ + * (actually a lumiera::test::MockInjector) */ Singleton MediaAccessFacade::instance; diff --git a/src/backend/mediaaccessfacade.hpp b/src/backend/mediaaccessfacade.hpp index 15579d491..63741b02e 100644 --- a/src/backend/mediaaccessfacade.hpp +++ b/src/backend/mediaaccessfacade.hpp @@ -59,7 +59,7 @@ namespace backend_interface * information from this file, NULL if the * file is not acessible. */ - virtual FileHandle queryFile (const char* name) throw(cinelerra::error::Invalid); + virtual FileHandle queryFile (const char* name) throw(lumiera::error::Invalid); /** request for information about the n-th channel * of the file refered by FileHandle. diff --git a/src/common/appconfig.cpp b/src/common/appconfig.cpp index fdf16cf40..612376022 100644 --- a/src/common/appconfig.cpp +++ b/src/common/appconfig.cpp @@ -34,7 +34,7 @@ using util::isnil; -namespace cinelerra +namespace lumiera { /** This internal pointer to the single instance is deliberately @@ -52,7 +52,7 @@ namespace cinelerra /** perform initialization on first access. * A call is placed in static initialization code - * included in cinelerra.h; thus it will happen + * included in lumiera.h; thus it will happen * probably very early. */ Appconfig::Appconfig() @@ -65,7 +65,7 @@ namespace cinelerra INFO(config, "Basic application configuration triggered."); // install our own handler for undeclared exceptions - std::set_unexpected (cinelerra::error::cinelerra_unexpectedException); + std::set_unexpected (lumiera::error::lumiera_unexpectedException); (*configParam_)["version"] = STRINGIFY (LUMIERA_VERSION); } @@ -89,10 +89,10 @@ namespace cinelerra catch (...) { ERROR(config, "error while accessing configuration parameter \"%s\".", key.c_str()); - throw cinelerra::error::Fatal (); + throw lumiera::error::Fatal (); } } -} // namespace cinelerra +} // namespace lumiera diff --git a/src/common/appconfig.hpp b/src/common/appconfig.hpp index bbd50df6f..984236755 100644 --- a/src/common/appconfig.hpp +++ b/src/common/appconfig.hpp @@ -34,8 +34,8 @@ */ -#ifndef CINELERRA_APPCONFIG_H -#define CINELERRA_APPCONFIG_H +#ifndef LUMIERA_APPCONFIG_H +#define LUMIERA_APPCONFIG_H #include #include @@ -45,7 +45,7 @@ -namespace cinelerra +namespace lumiera { using std::string; using boost::scoped_ptr; @@ -104,5 +104,5 @@ namespace cinelerra -} // namespace cinelerra +} // namespace lumiera #endif diff --git a/src/common/error.cpp b/src/common/error.cpp index 17e18e676..e708c5d3a 100644 --- a/src/common/error.cpp +++ b/src/common/error.cpp @@ -1,5 +1,5 @@ /* - Error - Cinelerra Exception Interface + Error - Lumiera Exception Interface Copyright (C) Lumiera.org 2008, Hermann Vosseler @@ -33,7 +33,7 @@ using util::isnil; using std::exception; -namespace cinelerra +namespace lumiera { namespace error @@ -46,23 +46,23 @@ namespace cinelerra */ inline const string default_usermsg (Error* exception_obj) throw() { - return string("Sorry, Cinelerra encountered an internal error. (") + return string("Sorry, Lumiera encountered an internal error. (") + typeid(*exception_obj).name() + ")"; } /* constants to be used as error IDs */ - CINELERRA_ERROR_DEFINE (LOGIC , "internal logic broken"); - CINELERRA_ERROR_DEFINE (FATAL , "floundered"); - CINELERRA_ERROR_DEFINE (CONFIG , "misconfiguration"); - CINELERRA_ERROR_DEFINE (STATE , "unforseen state"); - CINELERRA_ERROR_DEFINE (INVALID , "invalid input or parameters"); - CINELERRA_ERROR_DEFINE (EXTERNAL , "failure in external service"); - CINELERRA_ERROR_DEFINE (ASSERTION, "assertion failure"); + LUMIERA_ERROR_DEFINE (LOGIC , "internal logic broken"); + LUMIERA_ERROR_DEFINE (FATAL , "floundered"); + LUMIERA_ERROR_DEFINE (CONFIG , "misconfiguration"); + LUMIERA_ERROR_DEFINE (STATE , "unforseen state"); + LUMIERA_ERROR_DEFINE (INVALID , "invalid input or parameters"); + LUMIERA_ERROR_DEFINE (EXTERNAL , "failure in external service"); + LUMIERA_ERROR_DEFINE (ASSERTION, "assertion failure"); } // namespace error - CINELERRA_ERROR_DEFINE (EXCEPTION, "generic cinelerra exception"); + LUMIERA_ERROR_DEFINE (EXCEPTION, "generic Lumiera exception"); @@ -75,7 +75,7 @@ namespace cinelerra desc_ (description), cause_ ("") { - cinelerra_error_set (this->id_); + lumiera_error_set (this->id_); } @@ -87,7 +87,7 @@ namespace cinelerra desc_ (description), cause_ (extractCauseMsg(cause)) { - cinelerra_error_set (this->id_); + lumiera_error_set (this->id_); } @@ -103,7 +103,7 @@ namespace cinelerra /** Description of the problem, including the internal char constant - * in accordance to cinelerra's error identification scheme. + * in accordance to Lumiera's error identification scheme. * If a root cause can be obtained, this will be included in the * generated output as well. */ @@ -167,15 +167,15 @@ namespace cinelerra namespace error { - void cinelerra_unexpectedException () throw() + void lumiera_unexpectedException () throw() { const char* is_halted - = "### Cinelerra halted due to an unexpected Error ###"; + = "### Lumiera halted due to an unexpected Error ###"; std::cerr << "\n" << is_halted << "\n\n"; ERROR (NOBUG_ON, "%s", is_halted); - if (const char * errorstate = cinelerra_error ()) + if (const char * errorstate = lumiera_error ()) ERROR (NOBUG_ON, "last registered error was....\n%s", errorstate); std::terminate(); @@ -183,7 +183,7 @@ namespace cinelerra void assertion_terminate (const string& location) { - throw Fatal (location, CINELERRA_ERROR_ASSERTION) + throw Fatal (location, LUMIERA_ERROR_ASSERTION) .setUsermsg("Program terminated because of violating " "an internal consistency check."); } @@ -191,4 +191,4 @@ namespace cinelerra } // namespace error -} // namespace cinelerra +} // namespace lumiera diff --git a/src/common/error.hpp b/src/common/error.hpp index 15e60f022..4ccb8b1d7 100644 --- a/src/common/error.hpp +++ b/src/common/error.hpp @@ -1,5 +1,5 @@ /* - ERROR.hpp - Cinelerra Exception Interface + ERROR.hpp - Lumiera Exception Interface Copyright (C) Lumiera.org 2008, Hermann Vosseler @@ -21,26 +21,26 @@ */ -#ifndef CINELERRA_ERROR_HPP_ -#define CINELERRA_ERROR_HPP_ +#ifndef LUMIERA_ERROR_HPP_ +#define LUMIERA_ERROR_HPP_ #include #include "nobugcfg.h" #include "lib/error.h" -namespace cinelerra +namespace lumiera { using std::string; /** error-ID for unspecified exceptions */ - CINELERRA_ERROR_DECLARE(EXCEPTION); + LUMIERA_ERROR_DECLARE(EXCEPTION); /** * Interface and Baseclass of all Exceptions thrown - * from within cinelerra (C++) code. Common operations + * from within Lumiera (C++) code. Common operations * for getting an diagnostic message and for obtaining * the root cause, i.e. the first exception encountered * in a chain of exceptions. @@ -48,9 +48,9 @@ namespace cinelerra class Error : public std::exception { public: - Error (string description="", const char* id=CINELERRA_ERROR_EXCEPTION) throw(); + Error (string description="", const char* id=LUMIERA_ERROR_EXCEPTION) throw(); Error (std::exception& cause, - string description="", const char* id=CINELERRA_ERROR_EXCEPTION) throw(); + string description="", const char* id=LUMIERA_ERROR_EXCEPTION) throw(); Error (const Error&) throw(); virtual ~Error () throw() {}; @@ -58,7 +58,7 @@ namespace cinelerra /** yield a diagnostic message characterizing the problem */ virtual const char* what () const throw(); - /** the internal cinelerra-error-ID (was set as C-errorstate in ctor) */ + /** the internal Lumiera-error-ID (was set as C-errorstate in ctor) */ const char* getID () const throw() { return this->id_; } /** extract the message to be displayed for the user */ @@ -80,7 +80,7 @@ namespace cinelerra private: - const char* id_; ///< an CINELERRA_ERROR id, which is set as errorstate on construction + const char* id_; ///< an LUMIERA_ERROR id, which is set as errorstate on construction string msg_; ///< friendly message intended for users (to be localized) string desc_; ///< detailed description of the error situation for the developers mutable string what_; ///< buffer for generating the detailed description on demand @@ -105,68 +105,68 @@ namespace cinelerra * can be considered a severe design flaw; we can just * add some diagnostics prior to halting. */ - void cinelerra_unexpectedException () throw(); + void lumiera_unexpectedException () throw(); /** throw an error::Fatal indicating "assertion failure" */ void assertion_terminate (const string& location); /* constants to be used as error IDs */ - CINELERRA_ERROR_DECLARE (LOGIC ); ///< contradiction to internal logic assumptions detected - CINELERRA_ERROR_DECLARE (FATAL ); ///< unable to cope with, internal logic floundered - CINELERRA_ERROR_DECLARE (CONFIG ); ///< execution aborted due to misconfiguration - CINELERRA_ERROR_DECLARE (STATE ); ///< unforeseen internal state - CINELERRA_ERROR_DECLARE (INVALID ); ///< invalid input or parameters encountered - CINELERRA_ERROR_DECLARE (EXTERNAL ); ///< failure in external service the application relies on - CINELERRA_ERROR_DECLARE (ASSERTION); ///< assertion failure + LUMIERA_ERROR_DECLARE (LOGIC ); ///< contradiction to internal logic assumptions detected + LUMIERA_ERROR_DECLARE (FATAL ); ///< unable to cope with, internal logic floundered + LUMIERA_ERROR_DECLARE (CONFIG ); ///< execution aborted due to misconfiguration + LUMIERA_ERROR_DECLARE (STATE ); ///< unforeseen internal state + LUMIERA_ERROR_DECLARE (INVALID ); ///< invalid input or parameters encountered + LUMIERA_ERROR_DECLARE (EXTERNAL ); ///< failure in external service the application relies on + LUMIERA_ERROR_DECLARE (ASSERTION); ///< assertion failure /** Macro for creating derived exception classes properly - * integrated into cinelerra's exception hierarchy. Using + * integrated into Lumiera's exception hierarchy. Using * this macro asures that the new class will get the full * set of constructors and behaviour common to all exception * classes, so it should be used when creating an derived * exception type for more then stricly local purposes */ -#define CINELERRA_EXCEPTION_DECLARE(CLASS, PARENT, _ID_) \ - class CLASS : public PARENT \ - { \ - public: \ - CLASS (std::string description="", \ - const char* id=_ID_) throw() \ - : PARENT (description, id) {} \ - \ - CLASS (std::exception& cause, \ - std::string description="", \ - const char* id=_ID_) throw() \ - : PARENT (cause, description, id) {} \ +#define LUMIERA_EXCEPTION_DECLARE(CLASS, PARENT, _ID_) \ + class CLASS : public PARENT \ + { \ + public: \ + CLASS (std::string description="", \ + const char* id=_ID_) throw() \ + : PARENT (description, id) {} \ + \ + CLASS (std::exception& cause, \ + std::string description="", \ + const char* id=_ID_) throw() \ + : PARENT (cause, description, id) {} \ }; - //---------------------------CLASS-----PARENT--ID---------------------- - CINELERRA_EXCEPTION_DECLARE (Logic, Error, CINELERRA_ERROR_LOGIC); - CINELERRA_EXCEPTION_DECLARE (Fatal, Logic, CINELERRA_ERROR_FATAL); - CINELERRA_EXCEPTION_DECLARE (Config, Error, CINELERRA_ERROR_CONFIG); - CINELERRA_EXCEPTION_DECLARE (State, Error, CINELERRA_ERROR_STATE); - CINELERRA_EXCEPTION_DECLARE (Invalid, Error, CINELERRA_ERROR_INVALID); - CINELERRA_EXCEPTION_DECLARE (External, Error, CINELERRA_ERROR_EXTERNAL); + //-------------------------CLASS-----PARENT--ID---------------------- + LUMIERA_EXCEPTION_DECLARE (Logic, Error, LUMIERA_ERROR_LOGIC); + LUMIERA_EXCEPTION_DECLARE (Fatal, Logic, LUMIERA_ERROR_FATAL); + LUMIERA_EXCEPTION_DECLARE (Config, Error, LUMIERA_ERROR_CONFIG); + LUMIERA_EXCEPTION_DECLARE (State, Error, LUMIERA_ERROR_STATE); + LUMIERA_EXCEPTION_DECLARE (Invalid, Error, LUMIERA_ERROR_INVALID); + LUMIERA_EXCEPTION_DECLARE (External, Error, LUMIERA_ERROR_EXTERNAL); } // namespace error -} // namespace cinelerra +} // namespace lumiera /****************************************************** * if NoBug is used, redefine some macros - * to rather throw Cinelerra Errors instead of aborting + * to rather throw Lumiera Errors instead of aborting */ #ifdef NOBUG_ABORT #undef NOBUG_ABORT #define CIN_NOBUG_LOCATION \ std::string (NOBUG_BASENAME(__FILE__)) +":"+ NOBUG_STRINGIZE(__LINE__) + ", function " + __func__ #define NOBUG_ABORT \ - cinelerra::error::assertion_terminate (CIN_NOBUG_LOCATION); + lumiera::error::assertion_terminate (CIN_NOBUG_LOCATION); #endif -#endif // CINELERRA_ERROR_HPP_ +#endif // LUMIERA_ERROR_HPP_ diff --git a/src/common/factory.hpp b/src/common/factory.hpp index a4b953b3a..5645cfba6 100644 --- a/src/common/factory.hpp +++ b/src/common/factory.hpp @@ -21,14 +21,14 @@ */ -#ifndef CINELERRA_FACTORY_H -#define CINELERRA_FACTORY_H +#ifndef LUMIERA_FACTORY_H +#define LUMIERA_FACTORY_H #include -namespace cinelerra +namespace lumiera { namespace factory { @@ -141,5 +141,5 @@ namespace cinelerra using factory::Factory; -} // namespace cinelerra +} // namespace lumiera #endif diff --git a/src/common/multithread.hpp b/src/common/multithread.hpp index cc6eca1c6..1dbbac519 100644 --- a/src/common/multithread.hpp +++ b/src/common/multithread.hpp @@ -23,21 +23,21 @@ -#ifndef CINELERRA_MULTITHREAD_H -#define CINELERRA_MULTITHREAD_H +#ifndef LUMIERA_MULTITHREAD_H +#define LUMIERA_MULTITHREAD_H #include "nobugcfg.h" -namespace cinelerra +namespace lumiera { /** * Interface/Policy for managing parallelism issues. * Basically everything is forwarded to the corresponding backend functions, - * because managing threads and locking belongs to the cinelerra backend layer. + * because managing threads and locking belongs to the Lumiera backend layer. * - * @todo actually implement this policy using the cinelerra databackend. + * @todo actually implement this policy using the Lumiera databackend. */ struct Thread { @@ -52,5 +52,5 @@ namespace cinelerra }; -} // namespace cinelerra +} // namespace lumiera #endif diff --git a/src/common/singleton.hpp b/src/common/singleton.hpp index 9f149214f..c5de1474d 100644 --- a/src/common/singleton.hpp +++ b/src/common/singleton.hpp @@ -30,7 +30,7 @@ ** e.g. sometimes we want to include a hook for injecting Test Mock instances. ** ** You'll find the default Policies in singletonfactory.hpp and the default - ** definition of type cinelerra::singleton in singletonpreconfigure.hpp + ** definition of type lumiera::singleton in singletonpreconfigure.hpp ** ** @see SingletonFactory ** @see singleton::StaticCreate @@ -40,8 +40,8 @@ */ -#ifndef CINELERRA_SINGLETON_H -#define CINELERRA_SINGLETON_H +#ifndef LUMIERA_SINGLETON_H +#define LUMIERA_SINGLETON_H #include "common/singletonpolicies.hpp" diff --git a/src/common/singletonfactory.hpp b/src/common/singletonfactory.hpp index 319722fcf..026b6990e 100644 --- a/src/common/singletonfactory.hpp +++ b/src/common/singletonfactory.hpp @@ -31,8 +31,8 @@ This code is heavily inspired by -#ifndef CINELERRA_SINGLETONFACTORY_H -#define CINELERRA_SINGLETONFACTORY_H +#ifndef LUMIERA_SINGLETONFACTORY_H +#define LUMIERA_SINGLETONFACTORY_H #include "common/singletonpolicies.hpp" ///< several Policies usable together with SingletonFactory @@ -43,7 +43,7 @@ This code is heavily inspired by //#include -namespace cinelerra +namespace lumiera { /** @@ -136,5 +136,5 @@ namespace cinelerra ///// It seems this would either cost us much of the flexibility or get complicated ///// to a point where we could as well implement our own Depenency Injection Manager. -} // namespace cinelerra +} // namespace lumiera #endif diff --git a/src/common/singletonpolicies.hpp b/src/common/singletonpolicies.hpp index 5ae31b939..f0b448305 100644 --- a/src/common/singletonpolicies.hpp +++ b/src/common/singletonpolicies.hpp @@ -31,8 +31,8 @@ This code is heavily inspired by -#ifndef CINELERRA_SINGLETONPOLICIES_H -#define CINELERRA_SINGLETONPOLICIES_H +#ifndef LUMIERA_SINGLETONPOLICIES_H +#define LUMIERA_SINGLETONPOLICIES_H #include "common/multithread.hpp" #include "common/error.hpp" @@ -40,11 +40,11 @@ This code is heavily inspired by #include -namespace cinelerra +namespace lumiera { namespace singleton { - /* == several Policies usable in conjunction with cinelerra::Singleton == */ + /* === several Policies usable in conjunction with lumiera::Singleton === */ /** * Policy placing the Singleton instance into a statically allocated buffer @@ -133,13 +133,13 @@ namespace cinelerra /** * Policy for handling multithreaded access to the singleton instance - * @todo actually implement this policy using the cinelerra databackend. + * @todo actually implement this policy using the Lumiera databackend. */ template struct Multithreaded { typedef volatile S VolatileType; - typedef cinelerra::Thread::Lock Lock; + typedef lumiera::Thread::Lock Lock; }; @@ -156,5 +156,5 @@ namespace cinelerra } // namespace singleton -} // namespace cinelerra +} // namespace lumiera #endif diff --git a/src/common/singletonpreconfigure.hpp b/src/common/singletonpreconfigure.hpp index 9f3cfb8b2..e9b12e3d6 100644 --- a/src/common/singletonpreconfigure.hpp +++ b/src/common/singletonpreconfigure.hpp @@ -31,7 +31,7 @@ ** One reason why one wants special Singleton behaviour is testing: Without ** altering the executable, for running some tests we need to inject a Test Mock ** in place of some service object, so we can verify the behaviour of the code - ** using this service. For this, we mix cinelerra::test::MockInjector + ** using this service. For this, we mix lumiera::test::MockInjector ** into the actual Singleton type. ** ** @note we declare the specialisations into the target namespace @@ -41,13 +41,13 @@ */ -#ifndef CINELERRA_SINGLETONPRECONFIGURE_H -#define CINELERRA_SINGLETONPRECONFIGURE_H +#ifndef LUMIERA_SINGLETONPRECONFIGURE_H +#define LUMIERA_SINGLETONPRECONFIGURE_H #include "common/test/mockinjector.hpp" -namespace cinelerra +namespace lumiera { /** * Default Singleton configuration @@ -67,15 +67,15 @@ namespace cinelerra namespace test { class TestSingletonO; - using cinelerra::Singleton; + using lumiera::Singleton; } // namespace test -} // namespace cinelerra +} // namespace lumiera namespace backend_interface { class MediaAccessFacade; - using cinelerra::Singleton; + using lumiera::Singleton; } // namespace backend_interface @@ -87,7 +87,7 @@ namespace backend_interface /* Specialisation Definitions */ /* ************************** */ -namespace cinelerra +namespace lumiera { using test::MockInjector; @@ -104,7 +104,7 @@ namespace cinelerra : public MockInjector { }; -} // namespace cinelerra +} // namespace lumiera diff --git a/src/common/test/mockinjector.hpp b/src/common/test/mockinjector.hpp index 28258e91e..4daf78081 100644 --- a/src/common/test/mockinjector.hpp +++ b/src/common/test/mockinjector.hpp @@ -22,8 +22,8 @@ -#ifndef CINELERRA_TEST_MOCKINJECTOR_H -#define CINELERRA_TEST_MOCKINJECTOR_H +#ifndef LUMIERA_TEST_MOCKINJECTOR_H +#define LUMIERA_TEST_MOCKINJECTOR_H #include "common/singletonfactory.hpp" @@ -31,7 +31,7 @@ #include -namespace cinelerra +namespace lumiera { namespace test { @@ -90,5 +90,5 @@ namespace cinelerra } // namespace test -} // namespace cinelerra +} // namespace lumiera #endif diff --git a/src/common/test/suite.cpp b/src/common/test/suite.cpp index c81c88097..897a7d04f 100644 --- a/src/common/test/suite.cpp +++ b/src/common/test/suite.cpp @@ -133,7 +133,7 @@ namespace test TRACE(test, "Test-Suite( groupID=%s )\n", groupID.c_str () ); if (!testcases.getGroup(groupID)) - throw cinelerra::error::Invalid (); + throw lumiera::error::Invalid (); //throw "empty testsuite"; /////////// TODO Errorhandling! } @@ -155,7 +155,7 @@ namespace test { PTestMap tests = testcases.getGroup(groupID_); if (!tests) - throw cinelerra::error::Invalid (); ///////// TODO: pass error description + throw lumiera::error::Invalid (); ///////// TODO: pass error description if (0 < cmdline.size()) { @@ -209,7 +209,7 @@ namespace test } catch (...) { - std::cout << "PLANNED ============= " << cinelerra_error() << "\n"; + std::cout << "PLANNED ============= " << lumiera_error() << "\n"; } std::cout << "END\n"; } diff --git a/src/common/time.cpp b/src/common/time.cpp index c208fcb46..a37979c6b 100644 --- a/src/common/time.cpp +++ b/src/common/time.cpp @@ -25,7 +25,7 @@ #include -namespace cinelerra +namespace lumiera { // TODO: dummy values; should be adjusted when switching to the real time implementation provided by the backend @@ -34,4 +34,4 @@ namespace cinelerra const Time Time::MIN = -std::numeric_limits::max(); -} // namespace cinelerra +} // namespace lumiera diff --git a/src/common/time.hpp b/src/common/time.hpp index c4fc22244..d065c3f36 100644 --- a/src/common/time.hpp +++ b/src/common/time.hpp @@ -21,13 +21,13 @@ */ -#ifndef CINELERRA_TIME_H -#define CINELERRA_TIME_H +#ifndef LUMIERA_TIME_H +#define LUMIERA_TIME_H #include -namespace cinelerra +namespace lumiera { @@ -56,5 +56,5 @@ namespace cinelerra -} // namespace cinelerra +} // namespace lumiera #endif diff --git a/src/common/typelist.hpp b/src/common/typelist.hpp index 6d2720fcb..f358a605e 100644 --- a/src/common/typelist.hpp +++ b/src/common/typelist.hpp @@ -47,19 +47,19 @@ This code is heavily inspired by ** ** Interface for using this facility is the template Types(.....) for up to 20 Type parameters ** - ** @see cinelerra::visitor::Applicable usage example + ** @see lumiera::visitor::Applicable usage example ** @see typelisttest.cpp ** */ -#ifndef CINELERRA_TYPELIST_H -#define CINELERRA_TYPELIST_H +#ifndef LUMIERA_TYPELIST_H +#define LUMIERA_TYPELIST_H -namespace cinelerra +namespace lumiera { namespace typelist { @@ -116,5 +116,5 @@ namespace cinelerra } // namespace typelist -} // namespace cinelerra +} // namespace lumiera #endif diff --git a/src/common/visitor.cpp b/src/common/visitor.cpp index f702f809b..91b195623 100644 --- a/src/common/visitor.cpp +++ b/src/common/visitor.cpp @@ -23,7 +23,7 @@ #include "common/visitor.hpp" -namespace cinelerra +namespace lumiera { namespace visitor { @@ -32,4 +32,4 @@ namespace cinelerra } // namespace visitor -} // namespace cinelerra +} // namespace lumiera diff --git a/src/common/visitor.hpp b/src/common/visitor.hpp index 251254a88..837ddf713 100644 --- a/src/common/visitor.hpp +++ b/src/common/visitor.hpp @@ -37,7 +37,7 @@ Credits for many further implementation ideas go to /** @file visitor.hpp ** A library implementation of the Visitor Pattern taylored specifically - ** to cinelerra's needs within the Proc Layer. Visitor enables double dispatch + ** to Lumiera's needs within the Proc Layer. Visitor enables double dispatch ** calls, based both on the concrete type of some target object and the concrete type of ** a tool object being applied to this target. The code carrying out this tool application ** (and thus triggering the double dispatch) need not know any of these concret types and is @@ -73,8 +73,8 @@ Credits for many further implementation ideas go to -#ifndef CINELERRA_VISITOR_H -#define CINELERRA_VISITOR_H +#ifndef LUMIERA_VISITOR_H +#define LUMIERA_VISITOR_H #include "common/visitorpolicies.hpp" #include "common/visitordispatcher.hpp" @@ -82,7 +82,7 @@ Credits for many further implementation ideas go to #include "common/typelist.hpp" -namespace cinelerra +namespace lumiera { namespace visitor { @@ -229,5 +229,5 @@ namespace cinelerra } // namespace visitor -} // namespace cinelerra +} // namespace lumiera #endif diff --git a/src/common/visitordispatcher.hpp b/src/common/visitordispatcher.hpp index 0be12b2df..dcc28391b 100644 --- a/src/common/visitordispatcher.hpp +++ b/src/common/visitordispatcher.hpp @@ -22,8 +22,8 @@ -#ifndef CINELERRA_VISITORDISPATCHER_H -#define CINELERRA_VISITORDISPATCHER_H +#ifndef LUMIERA_VISITORDISPATCHER_H +#define LUMIERA_VISITORDISPATCHER_H #include "common/error.hpp" #include "common/util.hpp" @@ -33,7 +33,7 @@ #include -namespace cinelerra +namespace lumiera { namespace visitor { @@ -211,5 +211,5 @@ namespace cinelerra } // namespace visitor -} // namespace cinelerra +} // namespace lumiera #endif diff --git a/src/common/visitorpolicies.hpp b/src/common/visitorpolicies.hpp index 6b9f353a5..e59a2f5b2 100644 --- a/src/common/visitorpolicies.hpp +++ b/src/common/visitorpolicies.hpp @@ -22,20 +22,20 @@ /** @file visitorpolicies.hpp - ** Policies usable for configuring the cinelerra::visitor::Tool for different kinds of error handling. + ** Policies usable for configuring the lumiera::visitor::Tool for different kinds of error handling. ** @see buildertool.hpp for another flavor (calling and catch-all-function) ** */ -#ifndef CINELERRA_VISITORPOLICIES_H -#define CINELERRA_VISITORPOLICIES_H +#ifndef LUMIERA_VISITORPOLICIES_H +#define LUMIERA_VISITORPOLICIES_H #include "common/error.hpp" -namespace cinelerra +namespace lumiera { namespace visitor { @@ -65,7 +65,7 @@ namespace cinelerra RET onUnknown (TAR&) { - throw cinelerra::error::Config("unable to decide what tool operation to call"); + throw lumiera::error::Config("unable to decide what tool operation to call"); } }; @@ -73,5 +73,5 @@ namespace cinelerra } // namespace visitor -} // namespace cinelerra +} // namespace lumiera #endif diff --git a/src/lib/condition.c b/src/lib/condition.c index 2b0bc28e8..7427b431d 100644 --- a/src/lib/condition.c +++ b/src/lib/condition.c @@ -30,8 +30,8 @@ * @param self is a pointer to the condition variable to be initialized * @return self as given */ -CinelerraCondition -cinelerra_condition_init (CinelerraCondition self) +LumieraCondition +lumiera_condition_init (LumieraCondition self) { if (self) { @@ -47,15 +47,15 @@ cinelerra_condition_init (CinelerraCondition self) * @param self is a pointer to the condition variable to be destroyed * @return self as given */ -CinelerraCondition -cinelerra_condition_destroy (CinelerraCondition self) +LumieraCondition +lumiera_condition_destroy (LumieraCondition self) { if (self) { if (pthread_mutex_destroy (&self->mutex)) - CINELERRA_DIE; + LUMIERA_DIE; else if (pthread_cond_destroy (&self->cond)) - CINELERRA_DIE; + LUMIERA_DIE; } return self; } diff --git a/src/lib/condition.h b/src/lib/condition.h index 73da3685f..b2fd76c63 100644 --- a/src/lib/condition.h +++ b/src/lib/condition.h @@ -19,8 +19,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#ifndef CINELERRA_CONDITION_H -#define CINELERRA_CONDITION_H +#ifndef LUMIERA_CONDITION_H +#define LUMIERA_CONDITION_H #include "lib/locking.h" @@ -33,21 +33,21 @@ * Condition variables. * */ -struct cinelerra_condition_struct +struct lumiera_condition_struct { pthread_cond_t cond; pthread_mutex_t mutex; }; -typedef struct cinelerra_condition_struct cinelerra_condition; -typedef cinelerra_condition* CinelerraCondition; +typedef struct lumiera_condition_struct lumiera_condition; +typedef lumiera_condition* LumieraCondition; -CinelerraCondition -cinelerra_condition_init (CinelerraCondition self); +LumieraCondition +lumiera_condition_init (LumieraCondition self); -CinelerraCondition -cinelerra_condition_destroy (CinelerraCondition self); +LumieraCondition +lumiera_condition_destroy (LumieraCondition self); /** @@ -55,14 +55,14 @@ cinelerra_condition_destroy (CinelerraCondition self); * @param self condition variable to be signaled, must be given, all errors are fatal */ static inline void -cinelerra_condition_signal (CinelerraCondition self) +lumiera_condition_signal (LumieraCondition self) { REQUIRE (self); if (pthread_mutex_lock (&self->mutex)) - CINELERRA_DIE; + LUMIERA_DIE; pthread_cond_signal (&self->cond); if (pthread_mutex_unlock (&self->mutex)) - CINELERRA_DIE; + LUMIERA_DIE; } /** @@ -70,14 +70,14 @@ cinelerra_condition_signal (CinelerraCondition self) * @param self condition variable to be signaled, must be given, all errors are fatal */ static inline void -cinelerra_condition_broadcast (CinelerraCondition self) +lumiera_condition_broadcast (LumieraCondition self) { REQUIRE (self); if (pthread_mutex_lock (&self->mutex)) - CINELERRA_DIE; + LUMIERA_DIE; pthread_cond_broadcast (&self->cond); if (pthread_mutex_unlock (&self->mutex)) - CINELERRA_DIE; + LUMIERA_DIE; } @@ -87,44 +87,44 @@ cinelerra_condition_broadcast (CinelerraCondition self) /** * conditionacquirer used to manage the state of a condition variable. */ -struct cinelerra_conditionacquirer_struct +struct lumiera_conditionacquirer_struct { - CinelerraCondition cond; - enum cinelerra_lockstate state; + LumieraCondition cond; + enum lumiera_lockstate state; }; -typedef struct cinelerra_conditionacquirer_struct cinelerra_conditionacquirer; -typedef struct cinelerra_conditionacquirer_struct* CinelerraConditionacquirer; +typedef struct lumiera_conditionacquirer_struct lumiera_conditionacquirer; +typedef struct lumiera_conditionacquirer_struct* LumieraConditionacquirer; /* helper function for nobug */ static inline void -cinelerra_conditionacquirer_ensureunlocked (CinelerraConditionacquirer self) +lumiera_conditionacquirer_ensureunlocked (LumieraConditionacquirer self) { - ENSURE (self->state == CINELERRA_UNLOCKED, "forgot to unlock the condition mutex"); + ENSURE (self->state == LUMIERA_UNLOCKED, "forgot to unlock the condition mutex"); } /* override with a macro to use the cleanup checker */ -#define cinelerra_conditionacquirer \ -cinelerra_conditionacquirer NOBUG_CLEANUP(cinelerra_conditionacquirer_ensureunlocked) +#define lumiera_conditionacquirer \ +lumiera_conditionacquirer NOBUG_CLEANUP(lumiera_conditionacquirer_ensureunlocked) /** * initialize a conditionacquirer state * @param self conditionacquirer to be initialized, must be an automatic variable * @param cond associated condition variable - * @param state initial state of the mutex, either CINELERRA_LOCKED or CINELERRA_UNLOCKED + * @param state initial state of the mutex, either LUMIERA_LOCKED or LUMIERA_UNLOCKED * @return self as given * errors are fatal */ -static inline CinelerraConditionacquirer -cinelerra_conditionacquirer_init (CinelerraConditionacquirer self, CinelerraCondition cond, enum cinelerra_lockstate state) +static inline LumieraConditionacquirer +lumiera_conditionacquirer_init (LumieraConditionacquirer self, LumieraCondition cond, enum lumiera_lockstate state) { REQUIRE (self); REQUIRE (cond); self->cond = cond; self->state = state; - if (state == CINELERRA_LOCKED) + if (state == LUMIERA_LOCKED) if (pthread_mutex_lock (&cond->mutex)) - CINELERRA_DIE; + LUMIERA_DIE; return self; } @@ -135,15 +135,15 @@ cinelerra_conditionacquirer_init (CinelerraConditionacquirer self, CinelerraCond * @param self conditionacquirer associated with a condition variable */ static inline void -cinelerra_conditionacquirer_lock (CinelerraConditionacquirer self) +lumiera_conditionacquirer_lock (LumieraConditionacquirer self) { REQUIRE (self); - REQUIRE (self->state == CINELERRA_UNLOCKED, "mutex already locked"); + REQUIRE (self->state == LUMIERA_UNLOCKED, "mutex already locked"); if (pthread_mutex_lock (&self->cond->mutex)) - CINELERRA_DIE; + LUMIERA_DIE; - self->state = CINELERRA_LOCKED; + self->state = LUMIERA_LOCKED; } @@ -153,10 +153,10 @@ cinelerra_conditionacquirer_lock (CinelerraConditionacquirer self) * @param self conditionacquirer associated with a condition variable */ static inline void -cinelerra_conditionacquirer_wait (CinelerraConditionacquirer self) +lumiera_conditionacquirer_wait (LumieraConditionacquirer self) { REQUIRE (self); - REQUIRE (self->state == CINELERRA_LOCKED, "mutex must be locked"); + REQUIRE (self->state == LUMIERA_LOCKED, "mutex must be locked"); pthread_cond_wait (&self->cond->cond, &self->cond->mutex); } @@ -167,13 +167,13 @@ cinelerra_conditionacquirer_wait (CinelerraConditionacquirer self) * @param self conditionacquirer associated with a condition variable */ static inline int -cinelerra_conditionacquirer_unlock (CinelerraConditionacquirer self) +lumiera_conditionacquirer_unlock (LumieraConditionacquirer self) { REQUIRE (self); - REQUIRE (self->state == CINELERRA_LOCKED, "mutex was not locked"); + REQUIRE (self->state == LUMIERA_LOCKED, "mutex was not locked"); if (pthread_mutex_unlock (&self->cond->mutex)) - CINELERRA_DIE; - self->state = CINELERRA_UNLOCKED; + LUMIERA_DIE; + self->state = LUMIERA_UNLOCKED; } @@ -182,10 +182,10 @@ cinelerra_conditionacquirer_unlock (CinelerraConditionacquirer self) * @param self conditionacquirer associated with the condition variable to be signaled */ static inline void -cinelerra_conditionacquirer_signal (CinelerraConditionacquirer self) +lumiera_conditionacquirer_signal (LumieraConditionacquirer self) { REQUIRE (self); - REQUIRE (self->state == CINELERRA_LOCKED, "mutex was not locked"); + REQUIRE (self->state == LUMIERA_LOCKED, "mutex was not locked"); pthread_cond_signal (&self->cond->cond); } @@ -195,10 +195,10 @@ cinelerra_conditionacquirer_signal (CinelerraConditionacquirer self) * @param self conditionacquirer associated with the condition variable to be signaled */ static inline int -cinelerra_conditionacquirer_broadcast (CinelerraConditionacquirer self) +lumiera_conditionacquirer_broadcast (LumieraConditionacquirer self) { REQUIRE (self); - REQUIRE (self->state == CINELERRA_LOCKED, "mutex was not locked"); + REQUIRE (self->state == LUMIERA_LOCKED, "mutex was not locked"); pthread_cond_broadcast (&self->cond->cond); } diff --git a/src/lib/error.c b/src/lib/error.c index df881013b..81e24bad8 100644 --- a/src/lib/error.c +++ b/src/lib/error.c @@ -1,5 +1,5 @@ /* - error.c - Cinelerra Error handling + error.c - Lumiera Error handling Copyright (C) Lumiera.org 2008, Christian Thaeter @@ -24,41 +24,41 @@ #include "lib/error.h" /** - * @file C Error handling in Cinelerra. + * @file C Error handling in Lumiera. */ /* predefined errors */ -CINELERRA_ERROR_DEFINE (ERRNO, "errno"); +LUMIERA_ERROR_DEFINE (ERRNO, "errno"); /* Thread local storage */ -static pthread_key_t cinelerra_error_tls; -static pthread_once_t cinelerra_error_initialized = PTHREAD_ONCE_INIT; +static pthread_key_t lumiera_error_tls; +static pthread_once_t lumiera_error_initialized = PTHREAD_ONCE_INIT; static void -cinelerra_error_tls_init (void) +lumiera_error_tls_init (void) { - pthread_key_create (&cinelerra_error_tls, NULL); + pthread_key_create (&lumiera_error_tls, NULL); } /** * Set error state for the current thread. * If the error state of the current thread was cleared, then set it, else preserve the old state. - * @param nerr name of the error with 'CINELERRA_ERROR_' prefix (example: CINELERRA_ERROR_NO_MEMORY) + * @param nerr name of the error with 'LUMIERA_ERROR_' prefix (example: LUMIERA_ERROR_NO_MEMORY) * @return old state, that is NULL for success, when the state was cleared and a pointer to a pending * error when the error state was already set */ const char* -cinelerra_error_set (const char * nerr) +lumiera_error_set (const char * nerr) { - pthread_once (&cinelerra_error_initialized, cinelerra_error_tls_init); + pthread_once (&lumiera_error_initialized, lumiera_error_tls_init); - const char* err = pthread_getspecific (cinelerra_error_tls); + const char* err = pthread_getspecific (lumiera_error_tls); if (!err) - pthread_setspecific (cinelerra_error_tls, nerr); + pthread_setspecific (lumiera_error_tls, nerr); return err; } @@ -71,12 +71,12 @@ cinelerra_error_set (const char * nerr) * @return pointer to any pending error of this thread, NULL if no error is pending */ const char* -cinelerra_error () +lumiera_error () { - pthread_once (&cinelerra_error_initialized, cinelerra_error_tls_init); + pthread_once (&lumiera_error_initialized, lumiera_error_tls_init); - const char* err = pthread_getspecific (cinelerra_error_tls); + const char* err = pthread_getspecific (lumiera_error_tls); if (err) - pthread_setspecific (cinelerra_error_tls, NULL); + pthread_setspecific (lumiera_error_tls, NULL); return err; } diff --git a/src/lib/error.h b/src/lib/error.h index 322487de1..24c73f0a5 100644 --- a/src/lib/error.h +++ b/src/lib/error.h @@ -1,5 +1,5 @@ /* - error.h - Cinelerra Error handling + error.h - Lumiera Error handling Copyright (C) Lumiera.org 2008, Christian Thaeter @@ -18,8 +18,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#ifndef CINELERRA_ERROR_H -#define CINELERRA_ERROR_H +#ifndef LUMIERA_ERROR_H +#define LUMIERA_ERROR_H #ifdef __cplusplus extern "C" { @@ -31,7 +31,7 @@ extern "C" { #include /** - * @file C Error handling in Cinelerra, header. + * @file C Error handling in Lumiera, header. */ @@ -39,46 +39,46 @@ extern "C" { * Abort unconditionally with a 'Fatal Error!' message. * This macro is used whenever the program end up in a invalid state from which no runtime recovery is possible */ -#define CINELERRA_DIE do { NOBUG_ERROR(NOBUG_ON, "Fatal Error!"); abort(); } while(0) +#define LUMIERA_DIE do { NOBUG_ERROR(NOBUG_ON, "Fatal Error!"); abort(); } while(0) /** * Forward declare an error constant. * This macro eases the error declaration in header files - * @param err name of the error without the 'CINELERRA_ERROR_' prefix (example: NO_MEMORY) + * @param err name of the error without the 'LUMIERA_ERROR_' prefix (example: NO_MEMORY) */ -#define CINELERRA_ERROR_DECLARE(err) \ -extern const char* CINELERRA_ERROR_##err +#define LUMIERA_ERROR_DECLARE(err) \ +extern const char* LUMIERA_ERROR_##err /** * Definition and initialization of an error constant. * This macro eases the error definition in implementation files - * @param err name of the error without the 'CINELERRA_ERROR_' prefix (example: NO_MEMORY) + * @param err name of the error without the 'LUMIERA_ERROR_' prefix (example: NO_MEMORY) * @param msg message describing the error in plain english (example: "memory allocation failed") */ -#define CINELERRA_ERROR_DEFINE(err, msg) \ -const char* CINELERRA_ERROR_##err = "CINELERRA_ERROR_" #err ":" msg +#define LUMIERA_ERROR_DEFINE(err, msg) \ +const char* LUMIERA_ERROR_##err = "LUMIERA_ERROR_" #err ":" msg /** Helper macro to raise an error for the current thread. * This macro eases setting an error. It adds NoBug logging support to the low level error handling. * @param flag NoBug flag describing the subsystem where the error was raised - * @param err name of the error without the 'CINELERRA_ERROR_' prefix (example: NO_MEMORY) + * @param err name of the error without the 'LUMIERA_ERROR_' prefix (example: NO_MEMORY) */ -#define CINELERRA_ERROR_SET(flag, err) \ -(({ERROR (flag, "%s", strchr(CINELERRA_ERROR_##err, ':')+1);}), \ -cinelerra_error_set(CINELERRA_ERROR_##err)) +#define LUMIERA_ERROR_SET(flag, err) \ +(({ERROR (flag, "%s", strchr(LUMIERA_ERROR_##err, ':')+1);}), \ +lumiera_error_set(LUMIERA_ERROR_##err)) const char* -cinelerra_error_set (const char * err); +lumiera_error_set (const char * err); const char* -cinelerra_error (); +lumiera_error (); /* predefined errors */ -CINELERRA_ERROR_DECLARE (ERRNO); +LUMIERA_ERROR_DECLARE (ERRNO); #ifdef __cplusplus } /* extern "C" */ #endif -#endif /* CINELERRA_ERROR_H */ +#endif /* LUMIERA_ERROR_H */ diff --git a/src/lib/framerate.c b/src/lib/framerate.c index 717bab4bb..d8a2fa830 100644 --- a/src/lib/framerate.c +++ b/src/lib/framerate.c @@ -26,5 +26,5 @@ */ -CINELERRA_ERROR_DEFINE(FRAMERATE_ILLEGAL_TIME, "invalid time given"); -CINELERRA_ERROR_DEFINE(FRAMERATE_ILLEGAL_FRAME, "invalid frame given"); +LUMIERA_ERROR_DEFINE(FRAMERATE_ILLEGAL_TIME, "invalid time given"); +LUMIERA_ERROR_DEFINE(FRAMERATE_ILLEGAL_FRAME, "invalid frame given"); diff --git a/src/lib/framerate.h b/src/lib/framerate.h index c7c9d2adc..6b050c86e 100644 --- a/src/lib/framerate.h +++ b/src/lib/framerate.h @@ -19,8 +19,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#ifndef CINELERRA_FRAMERATE_H -#define CINELERRA_FRAMERATE_H +#ifndef LUMIERA_FRAMERATE_H +#define LUMIERA_FRAMERATE_H #include @@ -36,37 +36,37 @@ * framerates are defined as a rational number * for example NTSC with 30000/1001fps */ -struct cinelerra_framerate_struct +struct lumiera_framerate_struct { unsigned n; //numerator unsigned d; //denominator }; -typedef struct cinelerra_framerate_struct cinelerra_framerate; -typedef cinelerra_framerate* CinelerraFramerate; +typedef struct lumiera_framerate_struct lumiera_framerate; +typedef lumiera_framerate* LumieraFramerate; -typedef signed long cinelerra_framepos; +typedef signed long lumiera_framepos; -CINELERRA_ERROR_DECLARE(FRAMERATE_ILLEGAL_TIME); -CINELERRA_ERROR_DECLARE(FRAMERATE_ILLEGAL_FRAME); +LUMIERA_ERROR_DECLARE(FRAMERATE_ILLEGAL_TIME); +LUMIERA_ERROR_DECLARE(FRAMERATE_ILLEGAL_FRAME); -#define CINELERRA_FRAMEPOS_ERROR LONG_MIN +#define LUMIERA_FRAMEPOS_ERROR LONG_MIN /** * Get the frame number of a given time at a given frame rate. * frame indexing starts with 1 * @param framerate is a pointer to the framerate used, defined as rational number. Must be given. - * @param time is a pointer to a cinelerra_time which shall be converted. - * @return frame at the given time or CINELERRA_FRAMEPOS_ERROR on error. + * @param time is a pointer to a lumiera_time which shall be converted. + * @return frame at the given time or LUMIERA_FRAMEPOS_ERROR on error. */ -static inline cinelerra_framepos -cinelerra_framerate_frame_get_time (const CinelerraFramerate framerate, CinelerraTime time) +static inline lumiera_framepos +lumiera_framerate_frame_get_time (const LumieraFramerate framerate, LumieraTime time) { REQUIRE (framerate); if (!time || time->tv_sec == (time_t)-1) { - cinelerra_error_set(CINELERRA_ERROR_FRAMERATE_ILLEGAL_TIME); - return CINELERRA_FRAMEPOS_ERROR; + lumiera_error_set(LUMIERA_ERROR_FRAMERATE_ILLEGAL_TIME); + return LUMIERA_FRAMEPOS_ERROR; } /* we add a magic microsecond for rounding, because of integer truncation frames may be calculated at most 1us earlier, @@ -79,21 +79,21 @@ cinelerra_framerate_frame_get_time (const CinelerraFramerate framerate, Cinelerr * Get the start time for a frame. * frame indexing starts with 1 * @param framerate is a pointer to the framerate used, defined as rational number. Must be given. - * @param time is a pointer to a cinelerra_time which shall take the result. + * @param time is a pointer to a lumiera_time which shall take the result. * @param frame frame number to be converted to time. This frame number must be greater than 0. * @return the pointer given in time or NULL on error (or when it was given as time). */ -static inline CinelerraTime -cinelerra_framerate_time_get_time_frame (const CinelerraFramerate framerate, - CinelerraTime time, - cinelerra_framepos frame) +static inline LumieraTime +lumiera_framerate_time_get_time_frame (const LumieraFramerate framerate, + LumieraTime time, + lumiera_framepos frame) { REQUIRE (framerate); if (time) { if (frame < 1) { - cinelerra_error_set(CINELERRA_ERROR_FRAMERATE_ILLEGAL_FRAME); + lumiera_error_set(LUMIERA_ERROR_FRAMERATE_ILLEGAL_FRAME); return NULL; } diff --git a/src/lib/locking.h b/src/lib/locking.h index 2cf7f3700..01ad8bb29 100644 --- a/src/lib/locking.h +++ b/src/lib/locking.h @@ -19,8 +19,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#ifndef CINELERRA_LOCKING_H -#define CINELERRA_LOCKING_H +#ifndef LUMIERA_LOCKING_H +#define LUMIERA_LOCKING_H #include #include @@ -37,12 +37,12 @@ * * */ -enum cinelerra_lockstate +enum lumiera_lockstate { - CINELERRA_UNLOCKED, - CINELERRA_LOCKED, - CINELERRA_RDLOCKED, - CINELERRA_WRLOCKED + LUMIERA_UNLOCKED, + LUMIERA_LOCKED, + LUMIERA_RDLOCKED, + LUMIERA_WRLOCKED }; #endif diff --git a/src/lib/mutex.c b/src/lib/mutex.c index b644c00ca..a08d89e51 100644 --- a/src/lib/mutex.c +++ b/src/lib/mutex.c @@ -31,8 +31,8 @@ * @param self is a pointer to the mutex to be initialized * @return self as given */ -CinelerraMutex -cinelerra_mutex_init (CinelerraMutex self) +LumieraMutex +lumiera_mutex_init (LumieraMutex self) { if (self) { @@ -46,13 +46,13 @@ cinelerra_mutex_init (CinelerraMutex self) * @param self is a pointer to the mutex to be destroyed * @return self as given */ -CinelerraMutex -cinelerra_mutex_destroy (CinelerraMutex self) +LumieraMutex +lumiera_mutex_destroy (LumieraMutex self) { if (self) { if (pthread_mutex_destroy (&self->mutex)) - CINELERRA_DIE; + LUMIERA_DIE; } return self; } diff --git a/src/lib/mutex.h b/src/lib/mutex.h index 4dc4bac92..ced7118e2 100644 --- a/src/lib/mutex.h +++ b/src/lib/mutex.h @@ -19,8 +19,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#ifndef CINELERRA_MUTEX_H -#define CINELERRA_MUTEX_H +#ifndef LUMIERA_MUTEX_H +#define LUMIERA_MUTEX_H #include "lib/locking.h" @@ -33,58 +33,58 @@ * Mutex. * */ -struct cinelerra_mutex_struct +struct lumiera_mutex_struct { pthread_mutex_t mutex; }; -typedef struct cinelerra_mutex_struct cinelerra_mutex; -typedef cinelerra_mutex* CinelerraMutex; +typedef struct lumiera_mutex_struct lumiera_mutex; +typedef lumiera_mutex* LumieraMutex; -CinelerraMutex -cinelerra_mutex_init (CinelerraMutex self); +LumieraMutex +lumiera_mutex_init (LumieraMutex self); -CinelerraMutex -cinelerra_mutex_destroy (CinelerraMutex self); +LumieraMutex +lumiera_mutex_destroy (LumieraMutex self); /** * mutexacquirer used to manage the state of a mutex variable. */ -struct cinelerra_mutexacquirer_struct +struct lumiera_mutexacquirer_struct { - CinelerraMutex mutex; - enum cinelerra_lockstate state; + LumieraMutex mutex; + enum lumiera_lockstate state; }; -typedef struct cinelerra_mutexacquirer_struct cinelerra_mutexacquirer; -typedef struct cinelerra_mutexacquirer_struct* CinelerraMutexacquirer; +typedef struct lumiera_mutexacquirer_struct lumiera_mutexacquirer; +typedef struct lumiera_mutexacquirer_struct* LumieraMutexacquirer; /* helper function for nobug */ static inline void -cinelerra_mutexacquirer_ensureunlocked (CinelerraMutexacquirer self) +lumiera_mutexacquirer_ensureunlocked (LumieraMutexacquirer self) { - ENSURE (self->state == CINELERRA_UNLOCKED, "forgot to unlock mutex"); + ENSURE (self->state == LUMIERA_UNLOCKED, "forgot to unlock mutex"); } /* override with a macro to use the cleanup checker */ -#define cinelerra_mutexacquirer \ -cinelerra_mutexacquirer NOBUG_CLEANUP(cinelerra_mutexacquirer_ensureunlocked) +#define lumiera_mutexacquirer \ +lumiera_mutexacquirer NOBUG_CLEANUP(lumiera_mutexacquirer_ensureunlocked) /** * initialize a mutexacquirer state without mutex. * @param self mutexacquirer to be initialized, must be an automatic variable * @return self as given - * This initialization is used when cinelerra_mutexacquirer_try_mutex shall be used later + * This initialization is used when lumiera_mutexacquirer_try_mutex shall be used later */ -static inline CinelerraMutexacquirer -cinelerra_mutexacquirer_init (CinelerraMutexacquirer self) +static inline LumieraMutexacquirer +lumiera_mutexacquirer_init (LumieraMutexacquirer self) { REQUIRE (self); self->mutex = NULL; - self->state = CINELERRA_UNLOCKED; + self->state = LUMIERA_UNLOCKED; return self; } @@ -93,20 +93,20 @@ cinelerra_mutexacquirer_init (CinelerraMutexacquirer self) * initialize a mutexacquirer state * @param self mutexacquirer to be initialized, must be an automatic variable * @param mutex associated mutex - * @param state initial state of the mutex, either CINELERRA_LOCKED or CINELERRA_UNLOCKED + * @param state initial state of the mutex, either LUMIERA_LOCKED or LUMIERA_UNLOCKED * @return self as given * errors are fatal */ -static inline CinelerraMutexacquirer -cinelerra_mutexacquirer_init_mutex (CinelerraMutexacquirer self, CinelerraMutex mutex, enum cinelerra_lockstate state) +static inline LumieraMutexacquirer +lumiera_mutexacquirer_init_mutex (LumieraMutexacquirer self, LumieraMutex mutex, enum lumiera_lockstate state) { REQUIRE (self); REQUIRE (mutex); self->mutex = mutex; self->state = state; - if (state == CINELERRA_LOCKED) + if (state == LUMIERA_LOCKED) if (pthread_mutex_lock (&mutex->mutex)) - CINELERRA_DIE; + LUMIERA_DIE; return self; } @@ -118,25 +118,25 @@ cinelerra_mutexacquirer_init_mutex (CinelerraMutexacquirer self, CinelerraMutex * @param self mutexacquirer associated with a mutex variable */ static inline void -cinelerra_mutexacquirer_lock (CinelerraMutexacquirer self) +lumiera_mutexacquirer_lock (LumieraMutexacquirer self) { REQUIRE (self); - REQUIRE (self->state == CINELERRA_UNLOCKED, "mutex already locked"); + REQUIRE (self->state == LUMIERA_UNLOCKED, "mutex already locked"); if (pthread_mutex_lock (&self->mutex->mutex)) - CINELERRA_DIE; + LUMIERA_DIE; - self->state = CINELERRA_LOCKED; + self->state = LUMIERA_LOCKED; } /** * get the state of a lock. * @param self mutexacquirer associated with a mutex variable - * @return CINELERRA_LOCKED when the mutex is locked by this thead + * @return LUMIERA_LOCKED when the mutex is locked by this thead */ -static inline enum cinelerra_lockstate -cinelerra_mutexacquirer_state (CinelerraMutexacquirer self) +static inline enum lumiera_lockstate +lumiera_mutexacquirer_state (LumieraMutexacquirer self) { REQUIRE (self); return self->state; @@ -148,23 +148,23 @@ cinelerra_mutexacquirer_state (CinelerraMutexacquirer self) * must not already be locked * @param self mutexacquirer associated with a mutex variable * @param mutex pointer to a mutex which should be tried - * @return CINELERRA_LOCKED when the mutex got locked + * @return LUMIERA_LOCKED when the mutex got locked */ -static inline enum cinelerra_lockstate -cinelerra_mutexacquirer_try_mutex (CinelerraMutexacquirer self, CinelerraMutex mutex) +static inline enum lumiera_lockstate +lumiera_mutexacquirer_try_mutex (LumieraMutexacquirer self, LumieraMutex mutex) { REQUIRE (self); - REQUIRE (self->state == CINELERRA_UNLOCKED, "mutex already locked"); + REQUIRE (self->state == LUMIERA_UNLOCKED, "mutex already locked"); self->mutex=mutex; switch (pthread_mutex_trylock (&self->mutex->mutex)) { case 0: - return self->state = CINELERRA_LOCKED; + return self->state = LUMIERA_LOCKED; case EBUSY: - return CINELERRA_UNLOCKED; + return LUMIERA_UNLOCKED; default: - CINELERRA_DIE; + LUMIERA_DIE; } } @@ -175,13 +175,13 @@ cinelerra_mutexacquirer_try_mutex (CinelerraMutexacquirer self, CinelerraMutex m * @param self mutexacquirer associated with a mutex variable */ static inline void -cinelerra_mutexacquirer_unlock (CinelerraMutexacquirer self) +lumiera_mutexacquirer_unlock (LumieraMutexacquirer self) { REQUIRE (self); - REQUIRE (self->state == CINELERRA_LOCKED, "mutex was not locked"); + REQUIRE (self->state == LUMIERA_LOCKED, "mutex was not locked"); if (pthread_mutex_unlock (&self->mutex->mutex)) - CINELERRA_DIE; - self->state = CINELERRA_UNLOCKED; + LUMIERA_DIE; + self->state = LUMIERA_UNLOCKED; } #endif diff --git a/src/lib/plugin.c b/src/lib/plugin.c index f819f4a6a..87939533d 100644 --- a/src/lib/plugin.c +++ b/src/lib/plugin.c @@ -1,5 +1,5 @@ /* - plugin.c - Cinelerra Plugin loader + plugin.c - Lumiera Plugin loader Copyright (C) Lumiera.org 2008, Christian Thaeter @@ -34,48 +34,48 @@ /* TODO should be set by the build system to the actual plugin path */ -#define CINELERRA_PLUGIN_PATH "~/.cinelerra3/plugins:/usr/local/lib/cinelerra3/plugins:.libs" +#define LUMIERA_PLUGIN_PATH "~/.lumiera/plugins:/usr/local/lib/lumiera/plugins:.libs" -NOBUG_DEFINE_FLAG (cinelerra_plugin); +NOBUG_DEFINE_FLAG (lumiera_plugin); /* errors */ -CINELERRA_ERROR_DEFINE(PLUGIN_DLOPEN, "Could not open plugin"); -CINELERRA_ERROR_DEFINE(PLUGIN_HOOK, "Hook function failed"); -CINELERRA_ERROR_DEFINE(PLUGIN_NFILE, "No such plugin"); -CINELERRA_ERROR_DEFINE(PLUGIN_NIFACE, "No such interface"); -CINELERRA_ERROR_DEFINE(PLUGIN_REVISION, "Interface revision too old"); +LUMIERA_ERROR_DEFINE(PLUGIN_DLOPEN, "Could not open plugin"); +LUMIERA_ERROR_DEFINE(PLUGIN_HOOK, "Hook function failed"); +LUMIERA_ERROR_DEFINE(PLUGIN_NFILE, "No such plugin"); +LUMIERA_ERROR_DEFINE(PLUGIN_NIFACE, "No such interface"); +LUMIERA_ERROR_DEFINE(PLUGIN_REVISION, "Interface revision too old"); /* supported (planned) plugin types and their file extensions */ -enum cinelerra_plugin_type +enum lumiera_plugin_type { - CINELERRA_PLUGIN_NULL, - CINELERRA_PLUGIN_DYNLIB, - CINELERRA_PLUGIN_CSOURCE + LUMIERA_PLUGIN_NULL, + LUMIERA_PLUGIN_DYNLIB, + LUMIERA_PLUGIN_CSOURCE }; static const struct { const char* const ext; - enum cinelerra_plugin_type type; -} cinelerra_plugin_extensions [] = + enum lumiera_plugin_type type; +} lumiera_plugin_extensions [] = { - {"so", CINELERRA_PLUGIN_DYNLIB}, - {"o", CINELERRA_PLUGIN_DYNLIB}, - {"c", CINELERRA_PLUGIN_CSOURCE}, + {"so", LUMIERA_PLUGIN_DYNLIB}, + {"o", LUMIERA_PLUGIN_DYNLIB}, + {"c", LUMIERA_PLUGIN_CSOURCE}, /* extend here */ - {NULL, CINELERRA_PLUGIN_NULL} + {NULL, LUMIERA_PLUGIN_NULL} }; -struct cinelerra_plugin +struct lumiera_plugin { /* short name as queried ("effects/audio/normalize") used for sorting/finding */ const char* name; - /* long names as looked up ("/usr/local/lib/cinelerra3/plugins/effects/audio/normalize.so") */ + /* long names as looked up ("/usr/local/lib/lumiera/plugins/effects/audio/normalize.so") */ const char* pathname; /* use count for all interfaces of this plugin */ @@ -85,7 +85,7 @@ struct cinelerra_plugin time_t last; /* kind of plugin */ - enum cinelerra_plugin_type type; + enum lumiera_plugin_type type; /* dlopen handle */ void* handle; @@ -93,19 +93,19 @@ struct cinelerra_plugin /* global plugin registry */ -void* cinelerra_plugin_registry = NULL; +void* lumiera_plugin_registry = NULL; /* plugin operations are protected by one big mutex */ -pthread_mutex_t cinelerra_plugin_mutex = PTHREAD_MUTEX_INITIALIZER; +pthread_mutex_t lumiera_plugin_mutex = PTHREAD_MUTEX_INITIALIZER; /** * the compare function for the registry tree. - * Compares the names of two struct cinelerra_plugin. + * Compares the names of two struct lumiera_plugin. * @return 0 if a and b are equal, just like strcmp. */ static int -cinelerra_plugin_name_cmp (const void* a, const void* b) +lumiera_plugin_name_cmp (const void* a, const void* b) { - return strcmp (((struct cinelerra_plugin*) a)->name, ((struct cinelerra_plugin*) b)->name); + return strcmp (((struct lumiera_plugin*) a)->name, ((struct lumiera_plugin*) b)->name); } /** @@ -113,21 +113,21 @@ cinelerra_plugin_name_cmp (const void* a, const void* b) * always succeeds or aborts */ void -cinelerra_init_plugin (void) +lumiera_init_plugin (void) { - NOBUG_INIT_FLAG (cinelerra_plugin); + NOBUG_INIT_FLAG (lumiera_plugin); } /** * Find and set pathname for the plugin. * Searches through given path for given plugin, trying to find the file's location in the filesystem. * If found, self->pathname will be set to the found plugin file. - * @param self The cinelerra_plugin to open look for. + * @param self The lumiera_plugin to open look for. * @param path The path to search trough (paths seperated by ":") * @return 0 on success. -1 on error, or if plugin not found in path. */ int -cinelerra_plugin_lookup (struct cinelerra_plugin* self, const char* path) +lumiera_plugin_lookup (struct lumiera_plugin* self, const char* path) { if (!path) return -1; @@ -146,22 +146,22 @@ cinelerra_plugin_lookup (struct cinelerra_plugin* self, const char* path) for (char* tok = strtok_r (tpath, ":", &tmp); tok; tok = strtok_r (NULL, ":", &tmp)) { /*for each extension*/ - for (int i = 0; cinelerra_plugin_extensions[i].ext; ++i) + for (int i = 0; lumiera_plugin_extensions[i].ext; ++i) { /* path/name.extension */ - int r = snprintf(pathname, 1024, "%s/%s.%s", tok, self->name, cinelerra_plugin_extensions[i].ext); + int r = snprintf(pathname, 1024, "%s/%s.%s", tok, self->name, lumiera_plugin_extensions[i].ext); if (r >= 1024) return -1; /*TODO error handling, name too long*/ - TRACE (cinelerra_plugin, "trying %s", pathname); + TRACE (lumiera_plugin, "trying %s", pathname); if (!access(pathname, R_OK)) { /* got it */ - TRACE (cinelerra_plugin, "found %s", pathname); + TRACE (lumiera_plugin, "found %s", pathname); self->pathname = strdup (pathname); - if (!self->pathname) CINELERRA_DIE; - self->type = cinelerra_plugin_extensions[i].type; + if (!self->pathname) LUMIERA_DIE; + self->type = lumiera_plugin_extensions[i].type; return 0; } } @@ -181,44 +181,44 @@ cinelerra_plugin_lookup (struct cinelerra_plugin* self, const char* path) * @return handle to the interface or NULL in case of a error. The application shall cast this handle to * the actual interface type. */ -struct cinelerra_interface* -cinelerra_interface_open (const char* name, const char* interface, size_t min_revision) +struct lumiera_interface* +lumiera_interface_open (const char* name, const char* interface, size_t min_revision) { - //REQUIRE (min_revision > sizeof(struct cinelerra_interface), "try to use an empty interface eh?"); + //REQUIRE (min_revision > sizeof(struct lumiera_interface), "try to use an empty interface eh?"); REQUIRE (interface, "interface name must be given"); - pthread_mutex_lock (&cinelerra_plugin_mutex); + pthread_mutex_lock (&lumiera_plugin_mutex); - struct cinelerra_plugin plugin; - struct cinelerra_plugin** found; + struct lumiera_plugin plugin; + struct lumiera_plugin** found; plugin.name = name; /* for searching */ - found = tsearch (&plugin, &cinelerra_plugin_registry, cinelerra_plugin_name_cmp); - if (!found) CINELERRA_DIE; + found = tsearch (&plugin, &lumiera_plugin_registry, lumiera_plugin_name_cmp); + if (!found) LUMIERA_DIE; if (*found == &plugin) { - NOTICE (cinelerra_plugin, "new plugin"); + NOTICE (lumiera_plugin, "new plugin"); /* now really create new item */ - *found = malloc (sizeof (struct cinelerra_plugin)); - if (!*found) CINELERRA_DIE; + *found = malloc (sizeof (struct lumiera_plugin)); + if (!*found) LUMIERA_DIE; if (name) /* NULL is main app, no lookup needed */ { - /*lookup for $CINELERRA_PLUGIN_PATH*/ + /*lookup for $LUMIERA_PLUGIN_PATH*/ (*found)->name = strdup (name); - if (!(*found)->name) CINELERRA_DIE; + if (!(*found)->name) LUMIERA_DIE; - if (!!cinelerra_plugin_lookup (*found, getenv("CINELERRA_PLUGIN_PATH")) -#ifdef CINELERRA_PLUGIN_PATH - /* else lookup for -DCINELERRA_PLUGIN_PATH */ - && !!cinelerra_plugin_lookup (*found, CINELERRA_PLUGIN_PATH) + if (!!lumiera_plugin_lookup (*found, getenv("LUMIERA_PLUGIN_PATH")) +#ifdef LUMIERA_PLUGIN_PATH + /* else lookup for -DLUMIERA_PLUGIN_PATH */ + && !!lumiera_plugin_lookup (*found, LUMIERA_PLUGIN_PATH) #endif ) { - CINELERRA_ERROR_SET (cinelerra_plugin, PLUGIN_NFILE); + LUMIERA_ERROR_SET (lumiera_plugin, PLUGIN_NFILE); goto elookup; } } @@ -233,46 +233,46 @@ cinelerra_interface_open (const char* name, const char* interface, size_t min_re PLANNED("if .so like then dlopen; else if .c like tcc compile"); TODO("factor dlopen and dlsym out"); - TRACE(cinelerra_plugin, "trying to open %s", (*found)->pathname); + TRACE(lumiera_plugin, "trying to open %s", (*found)->pathname); (*found)->handle = dlopen ((*found)->pathname, RTLD_LAZY|RTLD_LOCAL); if (!(*found)->handle) { - ERROR (cinelerra_plugin, "dlopen failed: %s", dlerror()); - CINELERRA_ERROR_SET (cinelerra_plugin, PLUGIN_DLOPEN); + ERROR (lumiera_plugin, "dlopen failed: %s", dlerror()); + LUMIERA_ERROR_SET (lumiera_plugin, PLUGIN_DLOPEN); goto edlopen; } - /* if the plugin defines a 'cinelerra_plugin_init' function, we call it, must return 0 on success */ - int (*init)(void) = dlsym((*found)->handle, "cinelerra_plugin_init"); + /* if the plugin defines a 'lumiera_plugin_init' function, we call it, must return 0 on success */ + int (*init)(void) = dlsym((*found)->handle, "lumiera_plugin_init"); if (init && init()) { - //ERROR (cinelerra_plugin, "cinelerra_plugin_init failed: %s: %s", name, interface); - CINELERRA_ERROR_SET (cinelerra_plugin, PLUGIN_HOOK); + //ERROR (lumiera_plugin, "lumiera_plugin_init failed: %s: %s", name, interface); + LUMIERA_ERROR_SET (lumiera_plugin, PLUGIN_HOOK); goto einit; } } /* we have the plugin, now get the interface descriptor */ - struct cinelerra_interface* ret; + struct lumiera_interface* ret; dlerror(); ret = dlsym ((*found)->handle, interface); const char *dlerr = dlerror(); - TRACE(cinelerra_plugin, "%s", dlerr); - TODO ("need some way to tell 'interface not provided by plugin', maybe cinelerra_plugin_error()?"); + TRACE(lumiera_plugin, "%s", dlerr); + TODO ("need some way to tell 'interface not provided by plugin', maybe lumiera_plugin_error()?"); if (dlerr) { - //ERROR (cinelerra_plugin, "plugin %s doesnt provide interface %s", name, interface); - CINELERRA_ERROR_SET (cinelerra_plugin, PLUGIN_NIFACE); + //ERROR (lumiera_plugin, "plugin %s doesnt provide interface %s", name, interface); + LUMIERA_ERROR_SET (lumiera_plugin, PLUGIN_NIFACE); goto edlsym; } /* is the interface older than required? */ if (ret->size < min_revision) { - ERROR (cinelerra_plugin, "plugin %s provides older interface %s revision than required", name, interface); - CINELERRA_ERROR_SET (cinelerra_plugin, PLUGIN_REVISION); + ERROR (lumiera_plugin, "plugin %s provides older interface %s revision than required", name, interface); + LUMIERA_ERROR_SET (lumiera_plugin, PLUGIN_REVISION); goto erevision; } @@ -281,8 +281,8 @@ cinelerra_interface_open (const char* name, const char* interface, size_t min_re /* if the interface provides a 'open' function, call it now, must return 0 on success */ if (ret->open && ret->open()) { - ERROR (cinelerra_plugin, "open hook indicated an error"); - CINELERRA_ERROR_SET (cinelerra_plugin, PLUGIN_HOOK); + ERROR (lumiera_plugin, "open hook indicated an error"); + LUMIERA_ERROR_SET (lumiera_plugin, PLUGIN_HOOK); goto eopen; } @@ -290,7 +290,7 @@ cinelerra_interface_open (const char* name, const char* interface, size_t min_re (*found)->last = time (NULL); ret->use_count++; - pthread_mutex_unlock (&cinelerra_plugin_mutex); + pthread_mutex_unlock (&lumiera_plugin_mutex); return ret; /* Error cleanup */ @@ -304,8 +304,8 @@ cinelerra_interface_open (const char* name, const char* interface, size_t min_re free ((char*)(*found)->name); free (*found); *found = &plugin; - tdelete (&plugin, &cinelerra_plugin_registry, cinelerra_plugin_name_cmp); - pthread_mutex_unlock (&cinelerra_plugin_mutex); + tdelete (&plugin, &lumiera_plugin_registry, lumiera_plugin_name_cmp); + pthread_mutex_unlock (&lumiera_plugin_mutex); return NULL; } @@ -315,17 +315,17 @@ cinelerra_interface_open (const char* name, const char* interface, size_t min_re * @param ptr interface to be closed */ void -cinelerra_interface_close (void* ptr) +lumiera_interface_close (void* ptr) { - TRACE (cinelerra_plugin, "%p", ptr); + TRACE (lumiera_plugin, "%p", ptr); if(!ptr) return; - struct cinelerra_interface* self = (struct cinelerra_interface*) ptr; + struct lumiera_interface* self = (struct lumiera_interface*) ptr; - pthread_mutex_lock (&cinelerra_plugin_mutex); + pthread_mutex_lock (&lumiera_plugin_mutex); - struct cinelerra_plugin* plugin = self->plugin; + struct lumiera_plugin* plugin = self->plugin; plugin->use_count--; self->use_count--; @@ -339,16 +339,16 @@ cinelerra_interface_close (void* ptr) { TODO ("we dont want to close here, instead store time of recent use and make a expire run, already planned in my head"); - /* if the plugin defines a 'cinelerra_plugin_destroy' function, we call it */ - int (*destroy)(void) = dlsym(plugin->handle, "cinelerra_plugin_destroy"); + /* if the plugin defines a 'lumiera_plugin_destroy' function, we call it */ + int (*destroy)(void) = dlsym(plugin->handle, "lumiera_plugin_destroy"); if (destroy) destroy(); /* and now cleanup */ - tdelete (plugin, &cinelerra_plugin_registry, cinelerra_plugin_name_cmp); + tdelete (plugin, &lumiera_plugin_registry, lumiera_plugin_name_cmp); free ((char*)plugin->name); dlclose(plugin->handle); free (plugin); } - pthread_mutex_unlock (&cinelerra_plugin_mutex); + pthread_mutex_unlock (&lumiera_plugin_mutex); } diff --git a/src/lib/plugin.h b/src/lib/plugin.h index 45a22bf29..f8916ae96 100644 --- a/src/lib/plugin.h +++ b/src/lib/plugin.h @@ -18,8 +18,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#ifndef CINELERRA_PLUGIN_H -#define CINELERRA_PLUGIN_H +#ifndef LUMIERA_PLUGIN_H +#define LUMIERA_PLUGIN_H #ifdef __cplusplus extern "C" { @@ -37,55 +37,55 @@ extern "C" { */ -NOBUG_DECLARE_FLAG (cinelerra_plugin); +NOBUG_DECLARE_FLAG (lumiera_plugin); /* tool macros*/ -#define CINELERRA_INTERFACE_TYPE(name, version) struct cinelerra_interface_##name##_##version -#define CINELERRA_INTERFACE_CAST(name, version) (CINELERRA_INTERFACE_TYPE(name, version)*) +#define LUMIERA_INTERFACE_TYPE(name, version) struct lumiera_interface_##name##_##version +#define LUMIERA_INTERFACE_CAST(name, version) (LUMIERA_INTERFACE_TYPE(name, version)*) /* Interface definition */ -#define CINELERRA_INTERFACE(name, version, ...) \ -CINELERRA_INTERFACE_TYPE(name, version) \ +#define LUMIERA_INTERFACE(name, version, ...) \ +LUMIERA_INTERFACE_TYPE(name, version) \ { \ - struct cinelerra_interface interface_header_; \ + struct lumiera_interface interface_header_; \ __VA_ARGS__ \ } -#define CINELERRA_INTERFACE_PROTO(ret, name, params) ret (*name) params; +#define LUMIERA_INTERFACE_PROTO(ret, name, params) ret (*name) params; /* Interface instantiation */ -#define CINELERRA_INTERFACE_IMPLEMENT(iname, version, name, open, close, ...) \ -CINELERRA_INTERFACE_TYPE(iname, version) name##_##version = \ -{ \ - { \ - version, \ - sizeof(CINELERRA_INTERFACE_TYPE(iname, version)), \ - NULL, \ - 0, \ - open, \ - close \ - }, \ - __VA_ARGS__ \ +#define LUMIERA_INTERFACE_IMPLEMENT(iname, version, name, open, close, ...) \ +LUMIERA_INTERFACE_TYPE(iname, version) name##_##version = \ +{ \ + { \ + version, \ + sizeof(LUMIERA_INTERFACE_TYPE(iname, version)), \ + NULL, \ + 0, \ + open, \ + close \ + }, \ + __VA_ARGS__ \ } /* internally used */ -struct cinelerra_plugin; +struct lumiera_plugin; /** * This is the header for any interface exported by plugins. * Real interfaces append their functions at the end. There are few standard functions on each Interface * Every function is required to be implemnted. */ -struct cinelerra_interface +struct lumiera_interface { /// interface version number unsigned version; /// size of the full structure is used to determine the revision (adding a new function increments the size) size_t size; /// back reference to plugin - struct cinelerra_plugin* plugin; + struct lumiera_plugin* plugin; /// incremented for each user of this interface and decremented when closed unsigned use_count; @@ -96,15 +96,15 @@ struct cinelerra_interface }; void -cinelerra_init_plugin (void); +lumiera_init_plugin (void); -struct cinelerra_interface* -cinelerra_interface_open (const char* plugin, const char* name, size_t min_revision); +struct lumiera_interface* +lumiera_interface_open (const char* plugin, const char* name, size_t min_revision); void -cinelerra_interface_close (void* self); +lumiera_interface_close (void* self); /** * Tries to unload a plugin. @@ -113,24 +113,24 @@ cinelerra_interface_close (void* self); * @return 0 on success, else the number if users which keeping the plugin loaded */ int -cinelerra_plugin_unload (const char* plugin); +lumiera_plugin_unload (const char* plugin); /** * Tries to unload plugins which are not in use. - * Calls cinelerra_plugin_unload() for each Plugin which is not used for more than age seconds. + * Calls lumiera_plugin_unload() for each Plugin which is not used for more than age seconds. * This function might be infrequently called by the scheduler to remove things which are not needed. * @param age timeout in seconds when to unload plugins */ void -cinelerra_plugin_expire (time_t age); +lumiera_plugin_expire (time_t age); -CINELERRA_ERROR_DECLARE(PLUGIN_DLOPEN); -CINELERRA_ERROR_DECLARE(PLUGIN_HOOK); -CINELERRA_ERROR_DECLARE(PLUGIN_NFILE); -CINELERRA_ERROR_DECLARE(PLUGIN_NIFACE); -CINELERRA_ERROR_DECLARE(PLUGIN_REVISION); +LUMIERA_ERROR_DECLARE(PLUGIN_DLOPEN); +LUMIERA_ERROR_DECLARE(PLUGIN_HOOK); +LUMIERA_ERROR_DECLARE(PLUGIN_NFILE); +LUMIERA_ERROR_DECLARE(PLUGIN_NIFACE); +LUMIERA_ERROR_DECLARE(PLUGIN_REVISION); #ifdef __cplusplus } /* extern "C" */ #endif -#endif /* CINELERRA_PLUGIN_H */ +#endif /* LUMIERA_PLUGIN_H */ diff --git a/src/lib/references.c b/src/lib/references.c index a4c5eb247..ad4f9562f 100644 --- a/src/lib/references.c +++ b/src/lib/references.c @@ -40,17 +40,17 @@ * @param dtor destructor function which will be called on obj when the last strong reference gets deleted * @return self as given */ -CinelerraReference -cinelerra_reference_strong_init_once (CinelerraReference self, void* obj, void (*dtor)(void*)) +LumieraReference +lumiera_reference_strong_init_once (LumieraReference self, void* obj, void (*dtor)(void*)) { - CinelerraReftarget target = malloc (sizeof(cinelerra_reftarget)); - if (!target) CINELERRA_DIE; + LumieraReftarget target = malloc (sizeof(lumiera_reftarget)); + if (!target) LUMIERA_DIE; target->object = obj; target->dtor = dtor; target->strong_cnt = 1; target->weak_cnt = 0; - cinelerra_mutex_init (&target->lock); + lumiera_mutex_init (&target->lock); self->object = obj; self->target = target; @@ -66,16 +66,16 @@ cinelerra_reference_strong_init_once (CinelerraReference self, void* obj, void ( * @return self as given * destroying a reference is not thread safe as far as 2 threads try to concurrently destroy it! */ -CinelerraReference -cinelerra_reference_destroy (CinelerraReference self) +LumieraReference +lumiera_reference_destroy (LumieraReference self) { - CinelerraReftarget target = self->target; + LumieraReftarget target = self->target; /* defensive, lets detect errors if anything still tries to use this reference */ self->target = NULL; - cinelerra_mutexacquirer lock; - cinelerra_mutexacquirer_init_mutex (&lock, &target->lock, CINELERRA_LOCKED); + lumiera_mutexacquirer lock; + lumiera_mutexacquirer_init_mutex (&lock, &target->lock, LUMIERA_LOCKED); if (self->object) { @@ -89,8 +89,8 @@ cinelerra_reference_destroy (CinelerraReference self) if (!target->weak_cnt) { /* no weak refs either, destroy it */ - cinelerra_mutexacquirer_unlock (&lock); - cinelerra_mutex_destroy (&target->lock); + lumiera_mutexacquirer_unlock (&lock); + lumiera_mutex_destroy (&target->lock); free (target); return self; } @@ -102,13 +102,13 @@ cinelerra_reference_destroy (CinelerraReference self) if (!--target->weak_cnt && !target->strong_cnt) { /* was last weak reference, and no strong refs left */ - cinelerra_mutexacquirer_unlock (&lock); - cinelerra_mutex_destroy (&target->lock); + lumiera_mutexacquirer_unlock (&lock); + lumiera_mutex_destroy (&target->lock); free (target); return self; } } - cinelerra_mutexacquirer_unlock (&lock); + lumiera_mutexacquirer_unlock (&lock); return self; } @@ -118,11 +118,11 @@ cinelerra_reference_destroy (CinelerraReference self) * @return self as strong reference (always for strong references) or NULL if source is an invalidated weak reference, * in the later case the reference is constructed as weak reference barely to allow it be destroyed */ -CinelerraReference -cinelerra_reference_strong_init (CinelerraReference self, CinelerraReference source) +LumieraReference +lumiera_reference_strong_init (LumieraReference self, LumieraReference source) { - cinelerra_mutexacquirer lock; - cinelerra_mutexacquirer_init_mutex (&lock, &source->target->lock, CINELERRA_LOCKED); + lumiera_mutexacquirer lock; + lumiera_mutexacquirer_init_mutex (&lock, &source->target->lock, LUMIERA_LOCKED); self->object = source->target->object; self->target = source->target; @@ -136,7 +136,7 @@ cinelerra_reference_strong_init (CinelerraReference self, CinelerraReference sou ++self->target->weak_cnt; self = NULL; } - cinelerra_mutexacquirer_unlock (&lock); + lumiera_mutexacquirer_unlock (&lock); return self; } @@ -145,11 +145,11 @@ cinelerra_reference_strong_init (CinelerraReference self, CinelerraReference sou * @param source reference to copy * @return self (always for strong references) or NULL if self is an invalidated weak reference */ -CinelerraReference -cinelerra_reference_weak_init (CinelerraReference self, CinelerraReference source) +LumieraReference +lumiera_reference_weak_init (LumieraReference self, LumieraReference source) { - cinelerra_mutexacquirer lock; - cinelerra_mutexacquirer_init_mutex (&lock, &source->target->lock, CINELERRA_LOCKED); + lumiera_mutexacquirer lock; + lumiera_mutexacquirer_init_mutex (&lock, &source->target->lock, LUMIERA_LOCKED); self->object = NULL; self->target = source->target; @@ -159,7 +159,7 @@ cinelerra_reference_weak_init (CinelerraReference self, CinelerraReference sourc /* already invalidated */ self = NULL; - cinelerra_mutexacquirer_unlock (&lock); + lumiera_mutexacquirer_unlock (&lock); return self; } @@ -169,14 +169,14 @@ cinelerra_reference_weak_init (CinelerraReference self, CinelerraReference sourc * do nothing if the referene is already weak * @return self or NULL if the final strong reference got removed, */ -CinelerraReference -cinelerra_reference_weaken (restrict CinelerraReference self) +LumieraReference +lumiera_reference_weaken (restrict LumieraReference self) { /* is this a strong reference? */ if (self->object) { - cinelerra_mutexacquirer lock; - cinelerra_mutexacquirer_init_mutex (&lock, &self->target->lock, CINELERRA_LOCKED); + lumiera_mutexacquirer lock; + lumiera_mutexacquirer_init_mutex (&lock, &self->target->lock, LUMIERA_LOCKED); self->object = NULL; ++self->target->weak_cnt; @@ -187,7 +187,7 @@ cinelerra_reference_weaken (restrict CinelerraReference self) self->target->object = NULL; self = NULL; } - cinelerra_mutexacquirer_unlock (&lock); + lumiera_mutexacquirer_unlock (&lock); } return self; } @@ -198,14 +198,14 @@ cinelerra_reference_weaken (restrict CinelerraReference self) * only references of object which are not already destroyed can be strengthened * @return self when successful, NULL when the object was already destroyed, 'self' stays a dead weak reference in that case */ -CinelerraReference -cinelerra_reference_strengthen (CinelerraReference self) +LumieraReference +lumiera_reference_strengthen (LumieraReference self) { /* is this a weak reference? */ if (!self->object) { - cinelerra_mutexacquirer lock; - cinelerra_mutexacquirer_init_mutex (&lock, &self->target->lock, CINELERRA_LOCKED); + lumiera_mutexacquirer lock; + lumiera_mutexacquirer_init_mutex (&lock, &self->target->lock, LUMIERA_LOCKED); if (self->target->object) { @@ -215,7 +215,7 @@ cinelerra_reference_strengthen (CinelerraReference self) } else self = NULL; - cinelerra_mutexacquirer_unlock (&lock); + lumiera_mutexacquirer_unlock (&lock); } return self; } diff --git a/src/lib/references.h b/src/lib/references.h index a7de3f7f0..3e00457e7 100644 --- a/src/lib/references.h +++ b/src/lib/references.h @@ -19,8 +19,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#ifndef CINELERRA_REFERENCES_H -#define CINELERRA_REFERENCES_H +#ifndef LUMIERA_REFERENCES_H +#define LUMIERA_REFERENCES_H #include @@ -29,77 +29,77 @@ */ -typedef struct cinelerra_reference_struct cinelerra_reference; -typedef cinelerra_reference* CinelerraReference; +typedef struct lumiera_reference_struct lumiera_reference; +typedef lumiera_reference* LumieraReference; #include "lib/error.h" #include "lib/mutex.h" /* Implementation detail */ -struct cinelerra_reftarget_struct +struct lumiera_reftarget_struct { void* object; void (*dtor)(void*); unsigned strong_cnt; /*when strong becomes 0 obj is destroyed, if weak is 0 destroy target too*/ unsigned weak_cnt; /*when weak becomes 0 and !obj and lock strong is 0, destroy target */ - cinelerra_mutex lock; + lumiera_mutex lock; }; -typedef struct cinelerra_reftarget_struct cinelerra_reftarget; -typedef cinelerra_reftarget* CinelerraReftarget; +typedef struct lumiera_reftarget_struct lumiera_reftarget; +typedef lumiera_reftarget* LumieraReftarget; /** * A reference pointing to some other object */ -struct cinelerra_reference_struct +struct lumiera_reference_struct { void* object; /*set for strong, NULL for weak*/ - CinelerraReftarget target; + LumieraReftarget target; }; -#define cinelerra_reference \ -cinelerra_reference NOBUG_CLEANUP(cinelerra_reference_ensuredestroyed) +#define lumiera_reference \ +lumiera_reference NOBUG_CLEANUP(lumiera_reference_ensuredestroyed) /* helper function for nobug */ static inline void -cinelerra_reference_ensuredestroyed (CinelerraReference self) +lumiera_reference_ensuredestroyed (LumieraReference self) { ENSURE (!self->target, "forgot to destroy reference"); } -CinelerraReference -cinelerra_reference_strong_init_once (CinelerraReference self, void* obj, void (*dtor)(void*)); +LumieraReference +lumiera_reference_strong_init_once (LumieraReference self, void* obj, void (*dtor)(void*)); -CinelerraReference -cinelerra_reference_destroy (CinelerraReference self); +LumieraReference +lumiera_reference_destroy (LumieraReference self); /** * Get object from a strong reference. * @return pointer to object, NULL if applied to a weak reference */ static inline void* -cinelerra_reference_get (CinelerraReference self) +lumiera_reference_get (LumieraReference self) { ENSURE (self->target, "illegal reference (not initialized or already destroyed?)"); return self->object; } -CinelerraReference -cinelerra_reference_strong_init (CinelerraReference self, CinelerraReference source); +LumieraReference +lumiera_reference_strong_init (LumieraReference self, LumieraReference source); -CinelerraReference -cinelerra_reference_weak_init (CinelerraReference self, CinelerraReference source); +LumieraReference +lumiera_reference_weak_init (LumieraReference self, LumieraReference source); -CinelerraReference -cinelerra_reference_weaken (restrict CinelerraReference self); +LumieraReference +lumiera_reference_weaken (restrict LumieraReference self); -CinelerraReference -cinelerra_reference_strengthen (CinelerraReference self); +LumieraReference +lumiera_reference_strengthen (LumieraReference self); #endif diff --git a/src/lib/rwlock.c b/src/lib/rwlock.c index d60223e3c..c7ee3a37d 100644 --- a/src/lib/rwlock.c +++ b/src/lib/rwlock.c @@ -23,8 +23,8 @@ #include #include "lib/rwlock.h" -CINELERRA_ERROR_DEFINE(RWLOCK_AGAIN, "maximum number of readlocks exceed"); -CINELERRA_ERROR_DEFINE(RWLOCK_DEADLOCK, "deadlock detected"); +LUMIERA_ERROR_DEFINE(RWLOCK_AGAIN, "maximum number of readlocks exceed"); +LUMIERA_ERROR_DEFINE(RWLOCK_DEADLOCK, "deadlock detected"); /** * @file Read/write locks. @@ -36,8 +36,8 @@ CINELERRA_ERROR_DEFINE(RWLOCK_DEADLOCK, "deadlock detected"); * @param self is a pointer to the rwlock to be initialized * @return self as given */ -CinelerraRWLock -cinelerra_rwlock_init (CinelerraRWLock self) +LumieraRWLock +lumiera_rwlock_init (LumieraRWLock self) { if (self) { @@ -51,13 +51,13 @@ cinelerra_rwlock_init (CinelerraRWLock self) * @param self is a pointer to the rwlock to be initialized * @return self on success or NULL at error */ -CinelerraRWLock -cinelerra_rwlock_destroy (CinelerraRWLock self) +LumieraRWLock +lumiera_rwlock_destroy (LumieraRWLock self) { if (self) { if (pthread_rwlock_destroy (&self->rwlock)) - CINELERRA_DIE; + LUMIERA_DIE; } return self; } @@ -69,44 +69,44 @@ cinelerra_rwlock_destroy (CinelerraRWLock self) * initialize a rwlockacquirer state * @param self rwlockacquirer to be initialized, must be an automatic variable * @param rwlock associated rwlock - * @param state initial state of the mutex, either CINELERRA_RDLOCKED, CINELERRA_WRLOCKED or CINELERRA_UNLOCKED + * @param state initial state of the mutex, either LUMIERA_RDLOCKED, LUMIERA_WRLOCKED or LUMIERA_UNLOCKED * @return self as given or NULL on error */ -CinelerraRWLockacquirer -cinelerra_rwlockacquirer_init (CinelerraRWLockacquirer self, CinelerraRWLock rwlock, enum cinelerra_lockstate state) +LumieraRWLockacquirer +lumiera_rwlockacquirer_init (LumieraRWLockacquirer self, LumieraRWLock rwlock, enum lumiera_lockstate state) { REQUIRE (self); REQUIRE (rwlock); - REQUIRE (state != CINELERRA_LOCKED, "illegal state for rwlock"); + REQUIRE (state != LUMIERA_LOCKED, "illegal state for rwlock"); self->rwlock = rwlock; self->state = state; switch (state) { - case CINELERRA_RDLOCKED: + case LUMIERA_RDLOCKED: switch (pthread_rwlock_rdlock (&rwlock->rwlock)) { case 0: break; case EAGAIN: - cinelerra_error_set (CINELERRA_ERROR_RWLOCK_AGAIN); + lumiera_error_set (LUMIERA_ERROR_RWLOCK_AGAIN); return NULL; case EDEADLK: - cinelerra_error_set (CINELERRA_ERROR_RWLOCK_DEADLOCK); + lumiera_error_set (LUMIERA_ERROR_RWLOCK_DEADLOCK); return NULL; default: - CINELERRA_DIE; + LUMIERA_DIE; } - case CINELERRA_WRLOCKED: + case LUMIERA_WRLOCKED: switch (pthread_rwlock_wrlock (&rwlock->rwlock)) { case 0: break; case EDEADLK: - cinelerra_error_set (CINELERRA_ERROR_RWLOCK_DEADLOCK); + lumiera_error_set (LUMIERA_ERROR_RWLOCK_DEADLOCK); return NULL; default: - CINELERRA_DIE; + LUMIERA_DIE; } default: break; @@ -121,27 +121,27 @@ cinelerra_rwlockacquirer_init (CinelerraRWLockacquirer self, CinelerraRWLock rwl * @param self rwlockacquirer associated with a rwlock * @return self as given or NULL on error */ -CinelerraRWLockacquirer -cinelerra_rwlockacquirer_rdlock (CinelerraRWLockacquirer self) +LumieraRWLockacquirer +lumiera_rwlockacquirer_rdlock (LumieraRWLockacquirer self) { REQUIRE (self); - REQUIRE (self->state == CINELERRA_UNLOCKED, "rwlock already locked"); + REQUIRE (self->state == LUMIERA_UNLOCKED, "rwlock already locked"); switch (pthread_rwlock_rdlock (&self->rwlock->rwlock)) { case 0: break; case EAGAIN: - cinelerra_error_set (CINELERRA_ERROR_RWLOCK_AGAIN); + lumiera_error_set (LUMIERA_ERROR_RWLOCK_AGAIN); return NULL; case EDEADLK: - cinelerra_error_set (CINELERRA_ERROR_RWLOCK_DEADLOCK); + lumiera_error_set (LUMIERA_ERROR_RWLOCK_DEADLOCK); return NULL; default: - CINELERRA_DIE; + LUMIERA_DIE; } - self->state = CINELERRA_RDLOCKED; + self->state = LUMIERA_RDLOCKED; return self; } @@ -152,24 +152,24 @@ cinelerra_rwlockacquirer_rdlock (CinelerraRWLockacquirer self) * @param self rwlockacquirer associated with a rwlock * @return self as given or NULL on error */ -CinelerraRWLockacquirer -cinelerra_rwlockacquirer_wrlock (CinelerraRWLockacquirer self) +LumieraRWLockacquirer +lumiera_rwlockacquirer_wrlock (LumieraRWLockacquirer self) { REQUIRE (self); - REQUIRE (self->state == CINELERRA_UNLOCKED, "rwlock already locked"); + REQUIRE (self->state == LUMIERA_UNLOCKED, "rwlock already locked"); switch (pthread_rwlock_wrlock (&self->rwlock->rwlock)) { case 0: break; case EDEADLK: - cinelerra_error_set (CINELERRA_ERROR_RWLOCK_DEADLOCK); + lumiera_error_set (LUMIERA_ERROR_RWLOCK_DEADLOCK); return NULL; default: - CINELERRA_DIE; + LUMIERA_DIE; } - self->state = CINELERRA_WRLOCKED; + self->state = LUMIERA_WRLOCKED; return self; } diff --git a/src/lib/rwlock.h b/src/lib/rwlock.h index 266887e24..922a05e7b 100644 --- a/src/lib/rwlock.h +++ b/src/lib/rwlock.h @@ -19,8 +19,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#ifndef CINELERRA_RWLOCK_H -#define CINELERRA_RWLOCK_H +#ifndef LUMIERA_RWLOCK_H +#define LUMIERA_RWLOCK_H #ifndef _GNU_SOURCE #error "This header must be included with _GNU_SOURCE or _POSIX_C_SOURCE >= 200112L defined" @@ -31,8 +31,8 @@ #include "lib/locking.h" -CINELERRA_ERROR_DECLARE(RWLOCK_AGAIN); -CINELERRA_ERROR_DECLARE(RWLOCK_DEADLOCK); +LUMIERA_ERROR_DECLARE(RWLOCK_AGAIN); +LUMIERA_ERROR_DECLARE(RWLOCK_DEADLOCK); /** * @file Read/write locks, header. @@ -43,20 +43,20 @@ CINELERRA_ERROR_DECLARE(RWLOCK_DEADLOCK); * RWLock. * */ -struct cinelerra_rwlock_struct +struct lumiera_rwlock_struct { pthread_rwlock_t rwlock; }; -typedef struct cinelerra_rwlock_struct cinelerra_rwlock; -typedef cinelerra_rwlock* CinelerraRWLock; +typedef struct lumiera_rwlock_struct lumiera_rwlock; +typedef lumiera_rwlock* LumieraRWLock; -CinelerraRWLock -cinelerra_rwlock_init (CinelerraRWLock self); +LumieraRWLock +lumiera_rwlock_init (LumieraRWLock self); -CinelerraRWLock -cinelerra_rwlock_destroy (CinelerraRWLock self); +LumieraRWLock +lumiera_rwlock_destroy (LumieraRWLock self); @@ -64,35 +64,35 @@ cinelerra_rwlock_destroy (CinelerraRWLock self); /** * rwlockacquirer used to manage the state of a rwlock variable. */ -struct cinelerra_rwlockacquirer_struct +struct lumiera_rwlockacquirer_struct { - CinelerraRWLock rwlock; - enum cinelerra_lockstate state; + LumieraRWLock rwlock; + enum lumiera_lockstate state; }; -typedef struct cinelerra_rwlockacquirer_struct cinelerra_rwlockacquirer; -typedef struct cinelerra_rwlockacquirer_struct* CinelerraRWLockacquirer; +typedef struct lumiera_rwlockacquirer_struct lumiera_rwlockacquirer; +typedef struct lumiera_rwlockacquirer_struct* LumieraRWLockacquirer; /* helper function for nobug */ static inline void -cinelerra_rwlockacquirer_ensureunlocked (CinelerraRWLockacquirer self) +lumiera_rwlockacquirer_ensureunlocked (LumieraRWLockacquirer self) { - ENSURE (self->state == CINELERRA_UNLOCKED, "forgot to unlock the rwlock mutex"); + ENSURE (self->state == LUMIERA_UNLOCKED, "forgot to unlock the rwlock mutex"); } /* override with a macro to use the cleanup checker */ -#define cinelerra_rwlockacquirer \ -cinelerra_rwlockacquirer NOBUG_CLEANUP(cinelerra_rwlockacquirer_ensureunlocked) +#define lumiera_rwlockacquirer \ +lumiera_rwlockacquirer NOBUG_CLEANUP(lumiera_rwlockacquirer_ensureunlocked) -CinelerraRWLockacquirer -cinelerra_rwlockacquirer_init (CinelerraRWLockacquirer self, CinelerraRWLock rwlock, enum cinelerra_lockstate state); +LumieraRWLockacquirer +lumiera_rwlockacquirer_init (LumieraRWLockacquirer self, LumieraRWLock rwlock, enum lumiera_lockstate state); -CinelerraRWLockacquirer -cinelerra_rwlockacquirer_rdlock (CinelerraRWLockacquirer self); +LumieraRWLockacquirer +lumiera_rwlockacquirer_rdlock (LumieraRWLockacquirer self); -CinelerraRWLockacquirer -cinelerra_rwlockacquirer_wrlock (CinelerraRWLockacquirer self); +LumieraRWLockacquirer +lumiera_rwlockacquirer_wrlock (LumieraRWLockacquirer self); /** @@ -101,13 +101,13 @@ cinelerra_rwlockacquirer_wrlock (CinelerraRWLockacquirer self); * @param self rwlockacquirer associated with a rwlock variable */ static inline void -cinelerra_rwlockacquirer_unlock (CinelerraRWLockacquirer self) +lumiera_rwlockacquirer_unlock (LumieraRWLockacquirer self) { REQUIRE (self); - REQUIRE (self->state != CINELERRA_UNLOCKED, "rwlock was not locked"); + REQUIRE (self->state != LUMIERA_UNLOCKED, "rwlock was not locked"); if (pthread_rwlock_unlock (&self->rwlock->rwlock)) - CINELERRA_DIE; - self->state = CINELERRA_UNLOCKED; + LUMIERA_DIE; + self->state = LUMIERA_UNLOCKED; } diff --git a/src/lib/time.c b/src/lib/time.c index 4566e44b5..83bfd9797 100644 --- a/src/lib/time.c +++ b/src/lib/time.c @@ -21,6 +21,6 @@ #include "lib/error.h" -CINELERRA_ERROR_DEFINE(TIME_OVERFLOW, "Time overflow"); -CINELERRA_ERROR_DEFINE(TIME_UNDERFLOW, "Time underflow"); -CINELERRA_ERROR_DEFINE(TIME_NEGATIVE, "Time negative"); +LUMIERA_ERROR_DEFINE(TIME_OVERFLOW, "Time overflow"); +LUMIERA_ERROR_DEFINE(TIME_UNDERFLOW, "Time underflow"); +LUMIERA_ERROR_DEFINE(TIME_NEGATIVE, "Time negative"); diff --git a/src/lib/time.h b/src/lib/time.h index d4c05b71c..26b698742 100644 --- a/src/lib/time.h +++ b/src/lib/time.h @@ -19,8 +19,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#ifndef CINELERRA_TIME_H -#define CINELERRA_TIME_H +#ifndef LUMIERA_TIME_H +#define LUMIERA_TIME_H #include #include @@ -35,31 +35,31 @@ timehandling is a delicate business, be careful of precision errors accumulating - cinelerra_time is starting from zero, never becomes negative. + lumiera_time is starting from zero, never becomes negative. TODO explain how to use time */ /* over or underflow (tried to make a movie which has negative length? or more than some hundreds days?) */ -CINELERRA_ERROR_DECLARE(TIME_OVERFLOW); -CINELERRA_ERROR_DECLARE(TIME_UNDERFLOW); -CINELERRA_ERROR_DECLARE(TIME_NEGATIVE); +LUMIERA_ERROR_DECLARE(TIME_OVERFLOW); +LUMIERA_ERROR_DECLARE(TIME_UNDERFLOW); +LUMIERA_ERROR_DECLARE(TIME_NEGATIVE); /* Note: we measure time starting from zero, time never becomes negative (I didnt checked if the time types are signed) */ -typedef struct timeval cinelerra_time; -typedef cinelerra_time* CinelerraTime; +typedef struct timeval lumiera_time; +typedef lumiera_time* LumieraTime; /** * normalize time after operations. * used internally */ static inline void -cinelerra_time_normalize (CinelerraTime time) +lumiera_time_normalize (LumieraTime time) { REQUIRE (time); if (time->tv_usec >= 1000000) @@ -75,8 +75,8 @@ cinelerra_time_normalize (CinelerraTime time) * @param time Time to clear * @return time as given */ -static inline CinelerraTime -cinelerra_time_clear (CinelerraTime time) +static inline LumieraTime +lumiera_time_clear (LumieraTime time) { if(time) { @@ -91,14 +91,14 @@ cinelerra_time_clear (CinelerraTime time) * @param time Time to put current time into. * @return time as given */ -static inline CinelerraTime -cinelerra_time_current (CinelerraTime time) +static inline LumieraTime +lumiera_time_current (LumieraTime time) { if (time) { /* gettime should never ever fail in a correct program */ if (gettimeofday (time, NULL)) - CINELERRA_DIE; + LUMIERA_DIE; } return time; } @@ -110,8 +110,8 @@ cinelerra_time_current (CinelerraTime time) * @return time as given upon success, NULL if double time given was negative or given time didn't point * anywhere */ -static inline CinelerraTime -cinelerra_time_set_double (CinelerraTime time, double fp) +static inline LumieraTime +lumiera_time_set_double (LumieraTime time, double fp) { if (time) { @@ -125,7 +125,7 @@ cinelerra_time_set_double (CinelerraTime time, double fp) { time->tv_sec = (time_t)-1; time->tv_usec = (suseconds_t)-1; - cinelerra_error_set(CINELERRA_ERROR_TIME_NEGATIVE); + lumiera_error_set(LUMIERA_ERROR_TIME_NEGATIVE); } } return NULL; @@ -138,14 +138,14 @@ cinelerra_time_set_double (CinelerraTime time, double fp) * @param usec Microseconds to set * @param Time as given */ -static inline CinelerraTime -cinelerra_time_init (CinelerraTime time, time_t sec, suseconds_t usec) +static inline LumieraTime +lumiera_time_init (LumieraTime time, time_t sec, suseconds_t usec) { if (time) { time->tv_sec = sec; time->tv_usec = usec; - cinelerra_time_normalize (time); + lumiera_time_normalize (time); } return time; } @@ -156,7 +156,7 @@ cinelerra_time_init (CinelerraTime time, time_t sec, suseconds_t usec) * @return Seconds elapsed, -1 on error */ static inline time_t -cinelerra_time_sec (CinelerraTime time) +lumiera_time_sec (LumieraTime time) { if (time) return time->tv_sec; @@ -170,7 +170,7 @@ cinelerra_time_sec (CinelerraTime time) * @return Microseconds elapsed, -1 on error */ static inline suseconds_t -cinelerra_time_usec (CinelerraTime time) +lumiera_time_usec (LumieraTime time) { if (time) return time->tv_usec; @@ -184,7 +184,7 @@ cinelerra_time_usec (CinelerraTime time) * @return Floating point representation of time. NAN on error. */ static inline double -cinelerra_time_double_get (CinelerraTime time) +lumiera_time_double_get (LumieraTime time) { if (time) { @@ -204,8 +204,8 @@ cinelerra_time_double_get (CinelerraTime time) * @param src Time-source to copy from * @return dest as given */ -static inline CinelerraTime -cinelerra_time_copy (CinelerraTime dest, const CinelerraTime src) +static inline LumieraTime +lumiera_time_copy (LumieraTime dest, const LumieraTime src) { if (dest && src) { @@ -221,8 +221,8 @@ cinelerra_time_copy (CinelerraTime dest, const CinelerraTime src) * @param src Time to add to dest * @return dest as given, or NULL on overflow. */ -static inline CinelerraTime -cinelerra_time_add (CinelerraTime dest, const CinelerraTime src) +static inline LumieraTime +lumiera_time_add (LumieraTime dest, const LumieraTime src) { if (dest && src) { @@ -231,11 +231,11 @@ cinelerra_time_add (CinelerraTime dest, const CinelerraTime src) dest->tv_sec += src->tv_sec; dest->tv_usec += src->tv_usec; - cinelerra_time_normalize (dest); + lumiera_time_normalize (dest); if (dest->tv_sec < t) { - cinelerra_error_set (CINELERRA_ERROR_TIME_OVERFLOW); + lumiera_error_set (LUMIERA_ERROR_TIME_OVERFLOW); return NULL; } } @@ -248,8 +248,8 @@ cinelerra_time_add (CinelerraTime dest, const CinelerraTime src) * @param src Time to subtract from dest * @return dest as given, or NULL on underflow. */ -static inline CinelerraTime -cinelerra_time_sub (CinelerraTime dest, const CinelerraTime src) +static inline LumieraTime +lumiera_time_sub (LumieraTime dest, const LumieraTime src) { if (dest && src) { @@ -264,11 +264,11 @@ cinelerra_time_sub (CinelerraTime dest, const CinelerraTime src) dest->tv_usec += 1000000 - src->tv_usec; } - cinelerra_time_normalize (dest); + lumiera_time_normalize (dest); if (dest->tv_sec > t) { - cinelerra_error_set (CINELERRA_ERROR_TIME_UNDERFLOW); + lumiera_error_set (LUMIERA_ERROR_TIME_UNDERFLOW); return NULL; } } diff --git a/src/cinelerra.h b/src/lumiera.h similarity index 90% rename from src/cinelerra.h rename to src/lumiera.h index 30264a904..12b1578b9 100644 --- a/src/cinelerra.h +++ b/src/lumiera.h @@ -1,5 +1,5 @@ /* - CINELERRA.h - global definitions and common types + LUMIERA.h - global definitions and common types Copyright (C) Lumiera.org @@ -22,8 +22,8 @@ */ -#ifndef CINELERRA_H -#define CINELERRA_H +#ifndef LUMIERA_H +#define LUMIERA_H @@ -54,13 +54,13 @@ extern "C" { #include "common/error.hpp" -namespace cinelerra +namespace lumiera { /* additional global configuration goes here... */ -} // namespace cinelerra +} // namespace lumiera #endif /* ===================== (End) C++-Part ================= */ -#endif /*CINELERRA_H*/ +#endif /*LUMIERA_H*/ diff --git a/src/main.cpp b/src/main.cpp index 8d564ed87..398cdc3df 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -23,11 +23,11 @@ #include -#include "cinelerra.h" +#include "lumiera.h" using std::cout; using std::endl; -using cinelerra::Appconfig; +using lumiera::Appconfig; int main (int argc, char* argv[]) diff --git a/src/nobugcfg.h b/src/nobugcfg.h index 2cd719a87..916f28663 100644 --- a/src/nobugcfg.h +++ b/src/nobugcfg.h @@ -27,7 +27,7 @@ ** The idea is that configuration and some globally used flag ** declarations are to be kept in one central location. Normally, ** this header will be included by appconfig.hpp, which in turn gets - ** included by cinelerra.h + ** included by lumiera.h ** @par Besides the usual guarded declarations, this header contains ** one section with the corresponding definitions. This section ** is to be called by appconfig.cpp only, which deals with application diff --git a/src/plugin/helloplugin.c b/src/plugin/helloplugin.c index 62a033f4e..d75f55f94 100644 --- a/src/plugin/helloplugin.c +++ b/src/plugin/helloplugin.c @@ -1,12 +1,12 @@ /* * hello.c - demonstrates how to build a standalone tool (C source) - * integrated into the SCons based build system of Cinelerra + * integrated into the SCons based build system of Lumiera */ #include int main(int argc, char* argv[]) { - printf("hello cinelerra world"); + printf("hello lumiera world"); return 0; } diff --git a/src/pre.hpp b/src/pre.hpp index 8c504c368..19717c2bb 100644 --- a/src/pre.hpp +++ b/src/pre.hpp @@ -33,8 +33,8 @@ ** @see mobject.hpp usage example */ -#ifndef CINELERRA_PRE_HPP -#define CINELERRA_PRE_HPP +#ifndef LUMIERA_PRE_HPP +#define LUMIERA_PRE_HPP #include #include @@ -44,8 +44,8 @@ #include #include -#include "cinelerra.h" +#include "lumiera.h" -#endif /*CINELERRA_PRE_HPP*/ +#endif /*LUMIERA_PRE_HPP*/ diff --git a/src/proc/asset.cpp b/src/proc/asset.cpp index d97c2fd9e..99fd50670 100644 --- a/src/proc/asset.cpp +++ b/src/proc/asset.cpp @@ -111,7 +111,7 @@ namespace asset /**change the enablement status of this asset. */ bool - Asset::enable (bool on) throw(cinelerra::error::State) + Asset::enable (bool on) throw(lumiera::error::State) { if (on == this->enabled) return true; diff --git a/src/proc/asset.hpp b/src/proc/asset.hpp index cec77bec4..0387e85ba 100644 --- a/src/proc/asset.hpp +++ b/src/proc/asset.hpp @@ -155,7 +155,7 @@ namespace asset /** origin or authorship id. * Can be a project abbreviation, a package id or just the authors nickname or UID. * This allows for the compnent name to be more generic (e.g. "blur"). - * Default for all assets provided by the core cinelerra-3 codebase is "cin3". + * Default for all assets provided by the core Lumiera codebase is "lumi". */ const string org; @@ -284,7 +284,7 @@ namespace asset * @return \c false if the state could not be changed * due to parent objects being disabled */ - bool enable (bool on=true) throw(cinelerra::error::State); + bool enable (bool on=true) throw(lumiera::error::State); }; diff --git a/src/proc/asset/db.hpp b/src/proc/asset/db.hpp index 9f33b01af..af31df9a3 100644 --- a/src/proc/asset/db.hpp +++ b/src/proc/asset/db.hpp @@ -87,7 +87,7 @@ namespace asset DB () : table() { } ~DB () {clear();} - friend class cinelerra::singleton::StaticCreate; + friend class lumiera::singleton::StaticCreate; public: @@ -125,7 +125,7 @@ namespace asset table.clear(); } - catch (cinelerra::Error& EX) + catch (lumiera::Error& EX) { WARN (oper, "Problems while clearing Asset registry: %s", EX.what()); } diff --git a/src/proc/asset/media.cpp b/src/proc/asset/media.cpp index 1610e822e..60a1ecd19 100644 --- a/src/proc/asset/media.cpp +++ b/src/proc/asset/media.cpp @@ -116,7 +116,7 @@ namespace asset } - cinelerra::Time + lumiera::Time Media::getLength() const { return len_; @@ -177,7 +177,7 @@ namespace asset MediaFactory::PType MediaFactory::operator() (const string& file, const Category& cat) { - Asset::Ident key(extractName(file), cat, "cin3", 1); + Asset::Ident key(extractName(file), cat, "lumi", 1); return operator() (key, file); } @@ -220,21 +220,21 @@ namespace asset * but rather part or a multichannel (compound) media */ shared_ptr - MediaFactory::operator() (asset::Media& mediaref) throw(cinelerra::error::Invalid) + MediaFactory::operator() (asset::Media& mediaref) throw(lumiera::error::Invalid) { if (mediaref.checkCompound()) - throw cinelerra::error::Invalid (str(format("Attempt to create a asset::Clip from the media %s, " - "which is not toplevel but rather part or a compound " - "(multichannel) media. Found parent Media %s.") - % string(mediaref) - % string(*mediaref.checkCompound())) - ,CINELERRA_ERROR_PART_OF_COMPOUND - ); + throw lumiera::error::Invalid (str(format("Attempt to create a asset::Clip from the media %s, " + "which is not toplevel but rather part or a compound " + "(multichannel) media. Found parent Media %s.") + % string(mediaref) + % string(*mediaref.checkCompound())) + ,LUMIERA_ERROR_PART_OF_COMPOUND + ); asset::Clip* pC = new asset::Clip (mediaref); return AssetManager::instance().getPtr (*pC); } - CINELERRA_ERROR_DEFINE (PART_OF_COMPOUND, "part of compound used as toplevel element"); + LUMIERA_ERROR_DEFINE (PART_OF_COMPOUND, "part of compound used as toplevel element"); diff --git a/src/proc/asset/media.hpp b/src/proc/asset/media.hpp index 67c6a31ca..ce43d6231 100644 --- a/src/proc/asset/media.hpp +++ b/src/proc/asset/media.hpp @@ -50,7 +50,7 @@ namespace asset class MediaFactory; class ProcPatt; - using cinelerra::Time; + using lumiera::Time; template<> @@ -137,7 +137,7 @@ namespace asset /** * Factory specialized for creating Media Asset objects. */ - class MediaFactory : public cinelerra::Factory + class MediaFactory : public lumiera::Factory { public: typedef shared_ptr PType; @@ -151,11 +151,11 @@ namespace asset PType operator() (const char* file, asset::Kind); shared_ptr - operator() (asset::Media& mediaref) throw(cinelerra::error::Invalid); + operator() (asset::Media& mediaref) throw(lumiera::error::Invalid); }; - CINELERRA_ERROR_DECLARE (PART_OF_COMPOUND); + LUMIERA_ERROR_DECLARE (PART_OF_COMPOUND); diff --git a/src/proc/asset/meta.hpp b/src/proc/asset/meta.hpp index e995f53a3..89500c226 100644 --- a/src/proc/asset/meta.hpp +++ b/src/proc/asset/meta.hpp @@ -90,7 +90,7 @@ namespace asset /** * Factory specialized for createing Metadata Asset objects. */ - class MetaFactory : public cinelerra::Factory + class MetaFactory : public lumiera::Factory { public: typedef shared_ptr PType; diff --git a/src/proc/asset/proc.hpp b/src/proc/asset/proc.hpp index 229f66fcd..b98fa8014 100644 --- a/src/proc/asset/proc.hpp +++ b/src/proc/asset/proc.hpp @@ -89,7 +89,7 @@ namespace asset /** * Factory specialized for createing Processor Asset objects. */ - class ProcFactory : public cinelerra::Factory + class ProcFactory : public lumiera::Factory { public: typedef shared_ptr PType; diff --git a/src/proc/asset/struct.hpp b/src/proc/asset/struct.hpp index 24cc5c053..96dd63001 100644 --- a/src/proc/asset/struct.hpp +++ b/src/proc/asset/struct.hpp @@ -91,7 +91,7 @@ namespace asset /** * Factory specialized for createing Structural Asset objects. */ - class StructFactory : public cinelerra::Factory + class StructFactory : public lumiera::Factory { public: typedef shared_ptr PType; diff --git a/src/proc/asset/unknown.cpp b/src/proc/asset/unknown.cpp index 25d91936c..b47a60113 100644 --- a/src/proc/asset/unknown.cpp +++ b/src/proc/asset/unknown.cpp @@ -48,19 +48,19 @@ namespace asset * try to access the "real" media it stands for. */ Media::PMedia - Unknown::getOrg() throw(cinelerra::error::Invalid) + Unknown::getOrg() throw(lumiera::error::Invalid) { UNIMPLEMENTED ("how to get at the original media from a »Unknown« placeholder"); if (1==0) - throw cinelerra::error::Invalid (str(format("Unable to locate original media " - "for ID=%s, filename=\"%s\".") - % string(this->ident) - % string(this->getFilename())) - ,CINELERRA_ERROR_ORIG_NOT_FOUND - ); + throw lumiera::error::Invalid (str(format("Unable to locate original media " + "for ID=%s, filename=\"%s\".") + % string(this->ident) + % string(this->getFilename())) + ,LUMIERA_ERROR_ORIG_NOT_FOUND + ); } - CINELERRA_ERROR_DEFINE (ORIG_NOT_FOUND, "Media refered by placeholder not found"); + LUMIERA_ERROR_DEFINE (ORIG_NOT_FOUND, "Media refered by placeholder not found"); diff --git a/src/proc/asset/unknown.hpp b/src/proc/asset/unknown.hpp index aa9cd6ec3..bcd0bda9f 100644 --- a/src/proc/asset/unknown.hpp +++ b/src/proc/asset/unknown.hpp @@ -32,7 +32,7 @@ namespace asset { - const cinelerra::Time DUMMY_TIME (25); ///< @todo solve konfig management + const lumiera::Time DUMMY_TIME (25); ///< @todo solve konfig management /** * Placeholder Asset for unknown or unavailable media source. @@ -47,11 +47,11 @@ namespace asset friend class MediaFactory; public: - virtual Media::PMedia getOrg() throw(cinelerra::error::Invalid); + virtual Media::PMedia getOrg() throw(lumiera::error::Invalid); }; - CINELERRA_ERROR_DECLARE (ORIG_NOT_FOUND); + LUMIERA_ERROR_DECLARE (ORIG_NOT_FOUND); diff --git a/src/proc/assetmanager.cpp b/src/proc/assetmanager.cpp index bc6f42ecd..68843444a 100644 --- a/src/proc/assetmanager.cpp +++ b/src/proc/assetmanager.cpp @@ -38,8 +38,8 @@ using boost::format; using boost::bind; using util::for_each; -using cinelerra::Singleton; -using cinelerra::Thread; +using lumiera::Singleton; +using lumiera::Thread; namespace asset @@ -49,23 +49,23 @@ namespace asset * AssetManager error responses, caused by querying * invalid Asset IDs from the internal DB. */ - class IDErr : public cinelerra::error::Invalid + class IDErr : public lumiera::error::Invalid { public: IDErr (const char* eID, format fmt) - : cinelerra::error::Invalid(fmt.str(),eID) {} + : lumiera::error::Invalid(fmt.str(),eID) {} }; // ------pre-defined-common-error-cases--------------- // - CINELERRA_ERROR_DEFINE (UNKNOWN_ASSET_ID, "non-registered Asset ID"); - CINELERRA_ERROR_DEFINE (WRONG_ASSET_KIND, "wrong Asset kind, unable to cast"); + LUMIERA_ERROR_DEFINE (UNKNOWN_ASSET_ID, "non-registered Asset ID"); + LUMIERA_ERROR_DEFINE (WRONG_ASSET_KIND, "wrong Asset kind, unable to cast"); class UnknownID : public IDErr { public: - UnknownID (ID aID) : IDErr (CINELERRA_ERROR_UNKNOWN_ASSET_ID, + UnknownID (ID aID) : IDErr (LUMIERA_ERROR_UNKNOWN_ASSET_ID, format("Query for Asset with ID=%d, which up to now " "hasn't been created or encountered.") % aID) {} }; @@ -73,7 +73,7 @@ namespace asset class WrongKind : public IDErr { public: - WrongKind (Asset::Ident idi) : IDErr (CINELERRA_ERROR_WRONG_ASSET_KIND, + WrongKind (Asset::Ident idi) : IDErr (LUMIERA_ERROR_WRONG_ASSET_KIND, format("Request for Asset(%s), specifying an Asset kind, " "that doesn't match the actual type (and can't be " "casted either).") % string(idi)) {} @@ -110,7 +110,7 @@ namespace asset template ID AssetManager::reg (KIND* obj, const Asset::Ident& idi) - throw(cinelerra::error::Invalid) + throw(lumiera::error::Invalid) { typedef shared_ptr PType; AssetManager& _aMang (AssetManager::instance()); @@ -133,7 +133,7 @@ namespace asset template shared_ptr AssetManager::getAsset (const ID& id) - throw(cinelerra::error::Invalid) + throw(lumiera::error::Invalid) { if (shared_ptr obj = registry.get (id)) return obj; @@ -243,11 +243,11 @@ namespace asset template ID AssetManager::reg (Asset* obj, const Asset::Ident& idi); - template shared_ptr AssetManager::getAsset (const ID& id) throw(cinelerra::error::Invalid); - template shared_ptr AssetManager::getAsset (const ID& id) throw(cinelerra::error::Invalid); - template shared_ptr AssetManager::getAsset (const ID& id) throw(cinelerra::error::Invalid); - template shared_ptr AssetManager::getAsset (const ID& id) throw(cinelerra::error::Invalid); - template shared_ptr AssetManager::getAsset (const ID& id) throw(cinelerra::error::Invalid); + template shared_ptr AssetManager::getAsset (const ID& id) throw(lumiera::error::Invalid); + template shared_ptr AssetManager::getAsset (const ID& id) throw(lumiera::error::Invalid); + template shared_ptr AssetManager::getAsset (const ID& id) throw(lumiera::error::Invalid); + template shared_ptr AssetManager::getAsset (const ID& id) throw(lumiera::error::Invalid); + template shared_ptr AssetManager::getAsset (const ID& id) throw(lumiera::error::Invalid); template shared_ptr AssetManager::getPtr (const Asset& asset); template shared_ptr AssetManager::getPtr (const Media& asset); diff --git a/src/proc/assetmanager.hpp b/src/proc/assetmanager.hpp index d1b20e025..b2362db00 100644 --- a/src/proc/assetmanager.hpp +++ b/src/proc/assetmanager.hpp @@ -66,7 +66,7 @@ namespace asset public: - static cinelerra::Singleton instance; + static lumiera::Singleton instance; /** provide the unique ID for given Asset::Ident tuple */ static ID getID (const Asset::Ident&); @@ -77,7 +77,7 @@ namespace asset /** find and return corresponging object */ template - shared_ptr getAsset (const ID& id) throw(cinelerra::error::Invalid); + shared_ptr getAsset (const ID& id) throw(lumiera::error::Invalid); /** @return true if the given id is registered in the internal asset DB */ @@ -101,7 +101,7 @@ namespace asset */ template static ID reg (KIND* obj, const Asset::Ident& idi) - throw(cinelerra::error::Invalid); + throw(lumiera::error::Invalid); /** deleter function used by the Asset smart pointers to delete Asset objects */ static void destroy (Asset* aa) { delete aa; } @@ -110,13 +110,13 @@ namespace asset AssetManager (); - friend class cinelerra::singleton::StaticCreate; + friend class lumiera::singleton::StaticCreate; }; - CINELERRA_ERROR_DECLARE (UNKNOWN_ASSET_ID); ///< use of a non-registered Asset ID. - CINELERRA_ERROR_DECLARE (WRONG_ASSET_KIND); ///< Asset ID of wrong Asset kind, unable to cast. + LUMIERA_ERROR_DECLARE (UNKNOWN_ASSET_ID); ///< use of a non-registered Asset ID. + LUMIERA_ERROR_DECLARE (WRONG_ASSET_KIND); ///< Asset ID of wrong Asset kind, unable to cast. } // namespace asset diff --git a/src/proc/engine/codecadapter.hpp b/src/proc/engine/codecadapter.hpp index 5b4991177..724763eaa 100644 --- a/src/proc/engine/codecadapter.hpp +++ b/src/proc/engine/codecadapter.hpp @@ -38,7 +38,7 @@ namespace engine * process thus is integrated into the framework * of the Renderengine, while the actual implementation * can be delegated to an external library accessed - * through Cinelerra's datat backend. + * through Lumiera's data backend. */ class CodecAdapter : public Trafo {}; diff --git a/src/proc/engine/pluginadapter.hpp b/src/proc/engine/pluginadapter.hpp index b080b99ed..b771f1fbc 100644 --- a/src/proc/engine/pluginadapter.hpp +++ b/src/proc/engine/pluginadapter.hpp @@ -35,7 +35,7 @@ namespace engine /** * Adapter used to integrate an effects processor in the render pipeline. * Effects processors are typically defined in a separate library and - * will be loaded at runtime using Cinelerra's plugin interface. + * will be loaded at runtime using Lumiera's plugin interface. */ class PluginAdapter : public Trafo { diff --git a/src/proc/engine/processor.hpp b/src/proc/engine/processor.hpp index 70ec33f6c..6b7317886 100644 --- a/src/proc/engine/processor.hpp +++ b/src/proc/engine/processor.hpp @@ -24,7 +24,7 @@ #ifndef ENGINE_PROCESSOR_H #define ENGINE_PROCESSOR_H -#include "cinelerra.h" +#include "lumiera.h" #include "proc/stateproxy.hpp" @@ -40,10 +40,10 @@ namespace engine ExitNode * output; /** begin of the timerange covered by this processor */ - cinelerra::Time start; + lumiera::Time start; /**end (exclusive) of the timerange */ - cinelerra::Time end; + lumiera::Time end; }; diff --git a/src/proc/mobject/builder/buildertool.hpp b/src/proc/mobject/builder/buildertool.hpp index c4700bc0a..0985567d1 100644 --- a/src/proc/mobject/builder/buildertool.hpp +++ b/src/proc/mobject/builder/buildertool.hpp @@ -59,7 +59,7 @@ namespace mobject * an instantiation of the "Applicable" template parametrized with all * concrete Buildable classes, for which it wants calls to be dispatched. */ - typedef cinelerra::visitor::Tool BuilderTool; + typedef lumiera::visitor::Tool BuilderTool; template @@ -67,11 +67,11 @@ namespace mobject class TYPELIST // list of all concrete Buildables to be treated > class Applicable - : public cinelerra::visitor::Applicable + : public lumiera::visitor::Applicable { } ; - using cinelerra::typelist::Types; // convienience for the users of "Applicable" + using lumiera::typelist::Types; // convienience for the users of "Applicable" } // namespace mobject::builder @@ -80,7 +80,7 @@ namespace mobject /** * Marker Interface for classes Visitable by Builder tools. */ - class Buildable : public cinelerra::visitor::Visitable + class Buildable : public lumiera::visitor::Visitable { }; } // namespace mobject diff --git a/src/proc/mobject/mobject.hpp b/src/proc/mobject/mobject.hpp index b7c139f93..3d0222a3d 100644 --- a/src/proc/mobject/mobject.hpp +++ b/src/proc/mobject/mobject.hpp @@ -29,7 +29,7 @@ #include #include -#include "cinelerra.h" +#include "lumiera.h" #include "proc/mobject/builder/buildertool.hpp" #include "proc/mobject/placement.hpp" #include "proc/asset.hpp" // TODO finally not needed? @@ -55,13 +55,13 @@ namespace mobject /** * MObject is the interface class for all "Media Objects". * All the contents and elements that can be placed and - * manipulated and finally rendered within Cinelerra's EDL + * manipulated and finally rendered within Lumiera's EDL * are MObjects. */ class MObject : public Buildable { protected: - typedef cinelerra::Time Time; + typedef lumiera::Time Time; // TODO: how to represent time intervals best? Time length; diff --git a/src/proc/mobject/placement.hpp b/src/proc/mobject/placement.hpp index 71c654308..3e941b7d5 100644 --- a/src/proc/mobject/placement.hpp +++ b/src/proc/mobject/placement.hpp @@ -86,7 +86,7 @@ namespace mobject class Placement : protected shared_ptr { protected: - typedef cinelerra::Time Time; + typedef lumiera::Time Time; typedef session::Track* Track; diff --git a/src/proc/mobject/session.hpp b/src/proc/mobject/session.hpp index 48473d298..1dafb2e87 100644 --- a/src/proc/mobject/session.hpp +++ b/src/proc/mobject/session.hpp @@ -57,7 +57,7 @@ namespace mobject /** * The (current) Session holds all the user * visible content to be edited and manipulated - * within the Cinelerra Application. From a users + * within the Lumiera Application. From a users * perspective, it is a collection of Media Objects * (--> MObject) placed (--> Placement) onto virtual * Tracks. diff --git a/src/proc/mobject/session/locatingpin.hpp b/src/proc/mobject/session/locatingpin.hpp index dfc7f8696..c42d5bc3d 100644 --- a/src/proc/mobject/session/locatingpin.hpp +++ b/src/proc/mobject/session/locatingpin.hpp @@ -42,7 +42,7 @@ #define MOBJECT_SESSION_LOCATINGPIN_H -#include "cinelerra.h" +#include "lumiera.h" #include #include @@ -79,7 +79,7 @@ namespace mobject class LocatingPin { protected: - typedef cinelerra::Time Time; + typedef lumiera::Time Time; typedef session::Track* Track; typedef std::pair SolutionData; //TODO (ichthyo consideres better passing of solution by subclass) struct LocatingSolution; diff --git a/src/proc/mobject/session/segment.hpp b/src/proc/mobject/session/segment.hpp index 46b5929d4..0b8a6025b 100644 --- a/src/proc/mobject/session/segment.hpp +++ b/src/proc/mobject/session/segment.hpp @@ -26,7 +26,7 @@ #include -#include "cinelerra.h" +#include "lumiera.h" #include "proc/mobject/explicitplacement.hpp" @@ -49,7 +49,7 @@ namespace mobject class Segment { protected: - typedef cinelerra::Time Time; + typedef lumiera::Time Time; /** begin of this timeline segment. */ Time start; diff --git a/src/proc/mobject/session/session.cpp b/src/proc/mobject/session/session.cpp index 2e81d752e..ea6a559d9 100644 --- a/src/proc/mobject/session/session.cpp +++ b/src/proc/mobject/session/session.cpp @@ -37,7 +37,7 @@ #include "common/singleton.hpp" -using cinelerra::Singleton; +using lumiera::Singleton; using mobject::session::SessManager; using mobject::session::SessManagerImpl; diff --git a/src/proc/mobject/session/sessionimpl.cpp b/src/proc/mobject/session/sessionimpl.cpp index e0cab87cc..15e940843 100644 --- a/src/proc/mobject/session/sessionimpl.cpp +++ b/src/proc/mobject/session/sessionimpl.cpp @@ -60,7 +60,7 @@ namespace mobject catch (...) { focusEDL_ = 0; - throw cinelerra::error::Fatal ("unexpected exception while clearing EDLs"); + throw lumiera::error::Fatal ("unexpected exception while clearing EDLs"); } } diff --git a/src/proc/mobject/session/sessionimpl.hpp b/src/proc/mobject/session/sessionimpl.hpp index d145c4fe5..2c396f95c 100644 --- a/src/proc/mobject/session/sessionimpl.hpp +++ b/src/proc/mobject/session/sessionimpl.hpp @@ -90,7 +90,7 @@ namespace mobject boost::scoped_ptr pImpl_; SessManagerImpl() throw(); - friend class cinelerra::singleton::StaticCreate; + friend class lumiera::singleton::StaticCreate; public: virtual void clear () ; diff --git a/src/tool/hello.c b/src/tool/hello.c index 62a033f4e..d75f55f94 100644 --- a/src/tool/hello.c +++ b/src/tool/hello.c @@ -1,12 +1,12 @@ /* * hello.c - demonstrates how to build a standalone tool (C source) - * integrated into the SCons based build system of Cinelerra + * integrated into the SCons based build system of Lumiera */ #include int main(int argc, char* argv[]) { - printf("hello cinelerra world"); + printf("hello lumiera world"); return 0; } diff --git a/tests/10errorhandling.tests b/tests/10errorhandling.tests index 2492869c5..f2e4e9dfc 100644 --- a/tests/10errorhandling.tests +++ b/tests/10errorhandling.tests @@ -15,12 +15,12 @@ return: 0 END TEST "query error" get < #include -using cinelerra::error::Invalid; +using lumiera::error::Invalid; using util::for_each; using util::isnil; using std::cout; diff --git a/tests/components/backend/mediaaccessmock.hpp b/tests/components/backend/mediaaccessmock.hpp index e11d0a67a..06eedad5c 100644 --- a/tests/components/backend/mediaaccessmock.hpp +++ b/tests/components/backend/mediaaccessmock.hpp @@ -41,7 +41,7 @@ namespace backend_interface class MediaAccessMock : public MediaAccessFacade { public: - FileHandle queryFile (const char* name) throw(cinelerra::error::Invalid); + FileHandle queryFile (const char* name) throw(lumiera::error::Invalid); ChanDesc queryChannel (FileHandle, uint chanNo) throw(); }; diff --git a/tests/components/common/appconfigtest.cpp b/tests/components/common/appconfigtest.cpp index d65e29402..6cab57de8 100644 --- a/tests/components/common/appconfigtest.cpp +++ b/tests/components/common/appconfigtest.cpp @@ -33,7 +33,7 @@ using std::cout; -namespace cinelerra +namespace lumiera { namespace test { @@ -46,10 +46,10 @@ namespace cinelerra testAccess("version"); } - /** @test accessing a value from cinelerra::Appconfig */ + /** @test accessing a value from lumiera::Appconfig */ void testAccess (const string& key) { - string ver = cinelerra::Appconfig::get(key); + string ver = lumiera::Appconfig::get(key); ASSERT ( !util::isnil(ver)); } }; diff --git a/tests/components/common/exceptionerrortest.cpp b/tests/components/common/exceptionerrortest.cpp index 987c77d19..75a13d0ee 100644 --- a/tests/components/common/exceptionerrortest.cpp +++ b/tests/components/common/exceptionerrortest.cpp @@ -42,7 +42,7 @@ using std::cout; -namespace cinelerra +namespace lumiera { namespace test { @@ -50,11 +50,11 @@ namespace cinelerra /** local specific error-constant for use in the * construcor of the nested SpecificError class. */ - CINELERRA_ERROR_DEFINE(LIFE_AND_UNIVERSE, "and everything?"); - CINELERRA_ERROR_DEFINE(DERIVED, "convoluted exception"); + LUMIERA_ERROR_DEFINE(LIFE_AND_UNIVERSE, "and everything?"); + LUMIERA_ERROR_DEFINE(DERIVED, "convoluted exception"); /** declare a specific Error class with parent class error::external */ - CINELERRA_EXCEPTION_DECLARE (DerivedError, error::External, CINELERRA_ERROR_DERIVED); + LUMIERA_EXCEPTION_DECLARE (DerivedError, error::External, LUMIERA_ERROR_DERIVED); /********************************************************** @@ -134,29 +134,29 @@ namespace cinelerra } - /** @test by constructing an cinelerra::Error object, - * the corresponding cinelerra_error state is set automatically + /** @test by constructing an lumiera::Error object, + * the corresponding lumiera_error state is set automatically */ void checkErrorIntegration() { - cinelerra_error (); - ASSERT (!cinelerra_error ()); + lumiera_error (); + ASSERT (!lumiera_error ()); Error err1; - Error err2("boo",CINELERRA_ERROR_DERIVED); - ASSERT (err1.getID () == cinelerra_error ()); // (we didn't clear the first one!) + Error err2("boo",LUMIERA_ERROR_DERIVED); + ASSERT (err1.getID () == lumiera_error ()); // (we didn't clear the first one!) - Error err3("boooo",CINELERRA_ERROR_DERIVED); - ASSERT (err3.getID () == cinelerra_error ()); + Error err3("boooo",LUMIERA_ERROR_DERIVED); + ASSERT (err3.getID () == lumiera_error ()); SpecificError err4; - ASSERT (err4.getID () == CINELERRA_ERROR_LIFE_AND_UNIVERSE); - ASSERT (err4.getID () == cinelerra_error ()); + ASSERT (err4.getID () == LUMIERA_ERROR_LIFE_AND_UNIVERSE); + ASSERT (err4.getID () == lumiera_error ()); - ASSERT (!cinelerra_error ()); + ASSERT (!lumiera_error ()); } - /** @test the chaining of cinelerra::Exception objects + /** @test the chaining of lumiera::Exception objects * and the retrieval of the original root cause. */ void checkRootCauseChaining() @@ -186,7 +186,7 @@ namespace cinelerra * gets installed and invoked, which gives additional diagnostics.*/ void terminateUnknown () throw() { - cinelerra::Appconfig::instance(); + lumiera::Appconfig::instance(); // will cause initialisation of Appconfig, throw Error("You'll never get me, won't you?"); @@ -201,7 +201,7 @@ namespace cinelerra { int value; public: - SpecificError () : Invalid("don't panic",CINELERRA_ERROR_LIFE_AND_UNIVERSE), value(42) {} + SpecificError () : Invalid("don't panic",LUMIERA_ERROR_LIFE_AND_UNIVERSE), value(42) {} int revealIt () { return value; } }; @@ -220,7 +220,7 @@ namespace cinelerra catch (SpecificError& e) { cout << "caught: " << e.what() << "..the answer is: " << e.revealIt() << "\n"; } catch (error::Logic& e) { cout << "caught error::Logic: " << e.what() << "\n"; } catch (error::Invalid&e) { cout << "caught error::Invalid: " << e.what() << "\n"; } - catch (Error& e) { cout << "caught cinelerra::Error: " << e.what() << "\n"; } + catch (Error& e) { cout << "caught lumiera::Error: " << e.what() << "\n"; } catch (runtime_error& e) { cout << "caught std::runtime_error: " << e.what() << "\n"; } catch (exception& e) { cout << "caught std::exception: " << e.what() << "\n"; } catch (...) { cout << "caught an unknown exception\n"; } diff --git a/tests/components/common/factoryspecialtest.cpp b/tests/components/common/factoryspecialtest.cpp index de9eeee8b..ecf293cd9 100644 --- a/tests/components/common/factoryspecialtest.cpp +++ b/tests/components/common/factoryspecialtest.cpp @@ -38,7 +38,7 @@ using std::string; using std::cout; -namespace cinelerra +namespace lumiera { namespace test { @@ -323,4 +323,4 @@ namespace cinelerra } // namespace test -} // namespace cinelerra +} // namespace lumiera diff --git a/tests/components/common/factorytest.cpp b/tests/components/common/factorytest.cpp index 875266fce..6c96a337c 100644 --- a/tests/components/common/factorytest.cpp +++ b/tests/components/common/factorytest.cpp @@ -36,7 +36,7 @@ using std::string; using std::cout; -namespace cinelerra +namespace lumiera { namespace test { @@ -100,7 +100,7 @@ namespace cinelerra * further shared-ptrs, invoke a member function and * finally, when leaving the scope, our TargetObj * will be destroyed automatically. - * @see cinelerra::Factory + * @see lumiera::Factory */ class Factory_test : public Test { @@ -125,4 +125,4 @@ namespace cinelerra } // namespace test -} // namespace cinelerra +} // namespace lumiera diff --git a/tests/components/common/singletontest.cpp b/tests/components/common/singletontest.cpp index 558d7e674..b531d7e9c 100644 --- a/tests/components/common/singletontest.cpp +++ b/tests/components/common/singletontest.cpp @@ -38,7 +38,7 @@ using std::string; using std::cout; -namespace cinelerra +namespace lumiera { namespace test { @@ -72,9 +72,9 @@ namespace cinelerra /******************************************************************* * @test implement a Singleton class using our Singleton Template. * Expected results: no memory leaks. - * @see cinelerra::Singleton - * @see cinelerra::singleton::StaticCreate - * @see cinelerra::singleton::HeapCreate + * @see lumiera::Singleton + * @see lumiera::singleton::StaticCreate + * @see lumiera::singleton::HeapCreate */ class Singleton_test : public Test { @@ -136,4 +136,4 @@ namespace cinelerra } // namespace test -} // namespace cinelerra +} // namespace lumiera diff --git a/tests/components/common/singletontestmocktest.cpp b/tests/components/common/singletontestmocktest.cpp index b90b1a73c..ea5e1d70e 100644 --- a/tests/components/common/singletontestmocktest.cpp +++ b/tests/components/common/singletontestmocktest.cpp @@ -37,7 +37,7 @@ using std::string; using std::cout; -namespace cinelerra +namespace lumiera { namespace test { @@ -108,8 +108,8 @@ namespace cinelerra * @test inject a Mock object into the Singleton Factory, * to be returned and used in place of the original object. * Expected results: Mock(s) called, no memory leaks. - * @see cinelerra::Singleton - * @see cinelerra::singleton::Static + * @see lumiera::Singleton + * @see lumiera::singleton::Static */ class SingletonTestMock_test : public Test { @@ -214,4 +214,4 @@ namespace cinelerra } // namespace test -} // namespace cinelerra +} // namespace lumiera diff --git a/tests/components/common/testtargetobj.hpp b/tests/components/common/testtargetobj.hpp index 8a0728b95..28ac5890d 100644 --- a/tests/components/common/testtargetobj.hpp +++ b/tests/components/common/testtargetobj.hpp @@ -21,8 +21,8 @@ */ -#ifndef CINELERRA_TEST_TESTTARGETOBJ_H -#define CINELERRA_TEST_TESTTARGETOBJ_H +#ifndef LUMIERA_TEST_TESTTARGETOBJ_H +#define LUMIERA_TEST_TESTTARGETOBJ_H #include "common/test/run.hpp" @@ -41,7 +41,7 @@ using std::string; using std::cout; -namespace cinelerra +namespace lumiera { namespace test { @@ -107,5 +107,5 @@ namespace cinelerra } // namespace test -} // namespace cinelerra +} // namespace lumiera #endif diff --git a/tests/components/common/typelisttest.cpp b/tests/components/common/typelisttest.cpp index 1a2e383e8..42159d96c 100644 --- a/tests/components/common/typelisttest.cpp +++ b/tests/components/common/typelisttest.cpp @@ -30,7 +30,7 @@ using std::string; using std::cout; -namespace cinelerra +namespace lumiera { namespace typelist { @@ -97,4 +97,4 @@ namespace cinelerra } // namespace typelist -} // namespace cinelerra +} // namespace lumiera diff --git a/tests/components/common/visitingtoolconcept.cpp b/tests/components/common/visitingtoolconcept.cpp index 16578b6be..f2189ed09 100644 --- a/tests/components/common/visitingtoolconcept.cpp +++ b/tests/components/common/visitingtoolconcept.cpp @@ -24,7 +24,7 @@ /** @file visitingtoolconept.cpp ** While laying the foundations for EDL and Builder, Ichthyo came accross ** the necessity to create a custom implementation of the Visitor Pattern - ** optimally suited for Cinelerra's needs. This implementation file was + ** optimally suited for Lumiera's needs. This implementation file was ** used for the draft and is self-contained. The final solution was then ** extracted as library implementation to visitor.hpp ** @@ -60,13 +60,13 @@ #include #include -using cinelerra::Singleton; +using lumiera::Singleton; using boost::format; using std::string; using std::cout; -namespace cinelerra +namespace lumiera { namespace visitor_concept_draft { @@ -459,4 +459,4 @@ namespace cinelerra } // namespace visitor_concept_draft -} // namespace cinelerra +} // namespace lumiera diff --git a/tests/components/common/visitingtoolextendedtest.cpp b/tests/components/common/visitingtoolextendedtest.cpp index a25ebd95a..d29c60b26 100644 --- a/tests/components/common/visitingtoolextendedtest.cpp +++ b/tests/components/common/visitingtoolextendedtest.cpp @@ -32,7 +32,7 @@ using std::string; using std::cout; -namespace cinelerra +namespace lumiera { namespace visitor { @@ -226,4 +226,4 @@ namespace cinelerra } // namespace visitor -} // namespace cinelerra +} // namespace lumiera diff --git a/tests/components/common/visitingtooltest.cpp b/tests/components/common/visitingtooltest.cpp index 10edf233d..0263d9c88 100644 --- a/tests/components/common/visitingtooltest.cpp +++ b/tests/components/common/visitingtooltest.cpp @@ -32,7 +32,7 @@ using std::string; using std::cout; -namespace cinelerra +namespace lumiera { namespace visitor { @@ -159,4 +159,4 @@ namespace cinelerra } // namespace visitor -} // namespace cinelerra +} // namespace lumiera diff --git a/tests/components/helloworldtest.cpp b/tests/components/helloworldtest.cpp index 8398f19ad..d0c289986 100644 --- a/tests/components/helloworldtest.cpp +++ b/tests/components/helloworldtest.cpp @@ -31,7 +31,7 @@ using util::isnil; using boost::lexical_cast; -namespace cinelerra +namespace lumiera { namespace test { @@ -65,4 +65,4 @@ namespace cinelerra } // namespace test -} // namespace cinelerra +} // namespace lumiera diff --git a/tests/components/mainsuite.cpp b/tests/components/mainsuite.cpp index 924a982e3..aa500cdbe 100644 --- a/tests/components/mainsuite.cpp +++ b/tests/components/mainsuite.cpp @@ -1,5 +1,5 @@ /* - mainsuite.cpp - "the" cinelerra3 self test suite + mainsuite.cpp - "the" Lumiera self test suite Copyright (C) Lumiera.org 2008, Christian Thaeter diff --git a/tests/components/proc/asset/createassettest.cpp b/tests/components/proc/asset/createassettest.cpp index fa28d4472..d9302fc7c 100644 --- a/tests/components/proc/asset/createassettest.cpp +++ b/tests/components/proc/asset/createassettest.cpp @@ -100,14 +100,14 @@ namespace asset aMang.getAsset (ID(mm1->getID())); NOTREACHED; } - catch (cinelerra::error::Invalid& xxx) {ASSERT (xxx.getID()==CINELERRA_ERROR_WRONG_ASSET_KIND);} + catch (lumiera::error::Invalid& xxx) {ASSERT (xxx.getID()==LUMIERA_ERROR_WRONG_ASSET_KIND);} try { // try accessing nonexistant ID aMang.getAsset (ID (1234567890)); NOTREACHED; } - catch (cinelerra::error::Invalid& xxx) {ASSERT (xxx.getID()==CINELERRA_ERROR_UNKNOWN_ASSET_ID);} - cinelerra_error (); // reset errorflag + catch (lumiera::error::Invalid& xxx) {ASSERT (xxx.getID()==LUMIERA_ERROR_UNKNOWN_ASSET_ID);} + lumiera_error (); // reset errorflag // checking the Ident-Fields @@ -121,8 +121,8 @@ namespace asset ASSERT (mm3->ident.category == Category (VIDEO )); ASSERT (mm1->ident.org == "ichthyo"); - ASSERT (mm2->ident.org == "cin3"); - ASSERT (mm3->ident.org == "cin3"); + ASSERT (mm2->ident.org == "lumi"); + ASSERT (mm3->ident.org == "lumi"); ASSERT (mm1->ident.version == 5); ASSERT (mm2->ident.version == 1); @@ -159,19 +159,19 @@ namespace asset ASSERT (key2.name == "testfile2"); // name filled in automatically candi = asset::Media::create(string("testfile3.wav"), Category(AUDIO)); - ASSERT ( checkProperties (candi, Asset::Ident("testfile3", Category(AUDIO), "cin3", 1) + ASSERT ( checkProperties (candi, Asset::Ident("testfile3", Category(AUDIO), "lumi", 1) , "testfile3.wav")); candi = asset::Media::create("some/path/testfile4.wav", Category(AUDIO)); - ASSERT ( checkProperties (candi, Asset::Ident("testfile4", Category(AUDIO), "cin3", 1) + ASSERT ( checkProperties (candi, Asset::Ident("testfile4", Category(AUDIO), "lumi", 1) , "some/path/testfile4.wav")); candi = asset::Media::create("", Category(AUDIO,"sub/bin")); - ASSERT ( checkProperties (candi, Asset::Ident("nil", Category(AUDIO,"sub/bin"), "cin3", 1) + ASSERT ( checkProperties (candi, Asset::Ident("nil", Category(AUDIO,"sub/bin"), "lumi", 1) , "")); candi = asset::Media::create("", AUDIO); - ASSERT ( checkProperties (candi, Asset::Ident("nil", Category(AUDIO), "cin3", 1) + ASSERT ( checkProperties (candi, Asset::Ident("nil", Category(AUDIO), "lumi", 1) , "")); } diff --git a/tests/components/proc/asset/mediastructurequerytest.cpp b/tests/components/proc/asset/mediastructurequerytest.cpp index 866178fd4..7cbfcd847 100644 --- a/tests/components/proc/asset/mediastructurequerytest.cpp +++ b/tests/components/proc/asset/mediastructurequerytest.cpp @@ -44,7 +44,7 @@ namespace asset /*********************************************************************** * This test documents the Interface used by MediaFactory when loading - * media files for querying cinelerra's backend layer for information + * media files for querying Lumiera's backend layer for information * on how the media file is structured. */ class MediaStructureQuery_test : public Test diff --git a/tests/components/proc/mobject/controller/rendersegmenttest.cpp b/tests/components/proc/mobject/controller/rendersegmenttest.cpp index fac5568aa..a56c76480 100644 --- a/tests/components/proc/mobject/controller/rendersegmenttest.cpp +++ b/tests/components/proc/mobject/controller/rendersegmenttest.cpp @@ -46,7 +46,7 @@ namespace mobject /******************************************************************* * @test create a render process from a given segment of the EDL. * Basically this includes cooperation of all parts of the - * Cinelerra Proc Layer. For a prepared test-EDL we invoke the + * Lumiera Proc Layer. For a prepared test-EDL we invoke the * controller to create a render process. This includes building * the render pipeline. Finally, we analyze all the created * Structures. diff --git a/tests/components/proc/mobject/placementbasictest.cpp b/tests/components/proc/mobject/placementbasictest.cpp index 16b6a80d0..e3e237252 100644 --- a/tests/components/proc/mobject/placementbasictest.cpp +++ b/tests/components/proc/mobject/placementbasictest.cpp @@ -35,7 +35,7 @@ #include //using boost::format; -using cinelerra::Time; +using lumiera::Time; using util::contains; using std::string; using std::cout; diff --git a/tests/components/proc/mobject/session/addcliptest.cpp b/tests/components/proc/mobject/session/addcliptest.cpp index ffb794e95..3cb981270 100644 --- a/tests/components/proc/mobject/session/addcliptest.cpp +++ b/tests/components/proc/mobject/session/addcliptest.cpp @@ -32,7 +32,7 @@ #include //using boost::format; -using cinelerra::Time; +using lumiera::Time; using util::contains; using std::string; using std::cout; diff --git a/tests/components/proc/mobject/session/testclip.cpp b/tests/components/proc/mobject/session/testclip.cpp index ce659e708..ea17dd19d 100644 --- a/tests/components/proc/mobject/session/testclip.cpp +++ b/tests/components/proc/mobject/session/testclip.cpp @@ -44,7 +44,7 @@ namespace mobject asset::Media & createTestMedia () { - // install Mock-Interface to cinelerra backend + // install Mock-Interface to Lumiera backend MAF::instance.injectSubclass (new MediaAccessMock); PM media = asset::Media::create("test-2", VIDEO); // query magic filename MAF::instance.injectSubclass (0); // remove Mock-Interface @@ -70,7 +70,7 @@ namespace mobject { } }; - cinelerra::Singleton testbed_1; // invoke ctor when creating first TestClip... + lumiera::Singleton testbed_1; // invoke ctor when creating first TestClip... diff --git a/tests/error/errortest.c b/tests/error/errortest.c index 0fd95b600..d367c0742 100644 --- a/tests/error/errortest.c +++ b/tests/error/errortest.c @@ -25,7 +25,7 @@ #include "lib/error.h" -CINELERRA_ERROR_DEFINE(TEST, "test error"); +LUMIERA_ERROR_DEFINE(TEST, "test error"); int main (int argc, char** argv) @@ -35,31 +35,31 @@ main (int argc, char** argv) if (!strcmp(argv[1], "set")) { - cinelerra_error_set (CINELERRA_ERROR_TEST); + lumiera_error_set (LUMIERA_ERROR_TEST); } if (!strcmp(argv[1], "get_no")) { const char* err; - err = cinelerra_error (); + err = lumiera_error (); printf ("%p\n", err); } if (!strcmp(argv[1], "get")) { - cinelerra_error_set (CINELERRA_ERROR_TEST); + lumiera_error_set (LUMIERA_ERROR_TEST); const char* err; - err = cinelerra_error (); + err = lumiera_error (); printf ("%s\n", err); } if (!strcmp(argv[1], "get2")) { - cinelerra_error_set (CINELERRA_ERROR_TEST); + lumiera_error_set (LUMIERA_ERROR_TEST); const char* err; - err = cinelerra_error (); + err = lumiera_error (); printf ("%s\n", err); - err = cinelerra_error (); + err = lumiera_error (); printf ("%p\n", err); } diff --git a/tests/library/test-llist.c b/tests/library/test-llist.c index bf6c5aed5..bfaf99c65 100644 --- a/tests/library/test-llist.c +++ b/tests/library/test-llist.c @@ -26,7 +26,7 @@ #include "lib/framerate.h" -CINELERRA_ERROR_DEFINE(TEST, "test error"); +LUMIERA_ERROR_DEFINE(TEST, "test error"); int main (int argc, char** argv) diff --git a/tests/library/test-references.c b/tests/library/test-references.c index f56c7c9d7..c1509c341 100644 --- a/tests/library/test-references.c +++ b/tests/library/test-references.c @@ -25,7 +25,7 @@ #include "lib/references.h" -CINELERRA_ERROR_DEFINE(TEST, "test error"); +LUMIERA_ERROR_DEFINE(TEST, "test error"); struct example @@ -55,16 +55,16 @@ main (int argc, char** argv) struct example test; test.foo = 123; - cinelerra_reference hold; + lumiera_reference hold; - cinelerra_reference_strong_init_once (&hold, &test, example_dtor); + lumiera_reference_strong_init_once (&hold, &test, example_dtor); - struct example* r = cinelerra_reference_get (&hold); + struct example* r = lumiera_reference_get (&hold); printf ("got: %d\n", r->foo); - cinelerra_reference_destroy (&hold); + lumiera_reference_destroy (&hold); } else if (!strcmp(argv[1], "nodeinsert")) { diff --git a/tests/locking/condition.c b/tests/locking/condition.c index 6483ac0a9..7d79e9a7e 100644 --- a/tests/locking/condition.c +++ b/tests/locking/condition.c @@ -40,10 +40,10 @@ signaling_thread() int conditionforgotunlock () { - cinelerra_condition c; - cinelerra_condition_init (&c); + lumiera_condition c; + lumiera_condition_init (&c); - cinelerra_conditionacquirer l; - cinelerra_conditionacquirer_init (&l, &c, CINELERRA_LOCKED); + lumiera_conditionacquirer l; + lumiera_conditionacquirer_init (&l, &c, LUMIERA_LOCKED); return 0; } diff --git a/tests/locking/mutex.c b/tests/locking/mutex.c index ed6a050eb..f4f8c18f6 100644 --- a/tests/locking/mutex.c +++ b/tests/locking/mutex.c @@ -23,10 +23,10 @@ int mutexforgotunlock() { - cinelerra_mutex m; - cinelerra_mutex_init (&m); + lumiera_mutex m; + lumiera_mutex_init (&m); - cinelerra_mutexacquirer l; - cinelerra_mutexacquirer_init_mutex (&l, &m, CINELERRA_LOCKED); + lumiera_mutexacquirer l; + lumiera_mutexacquirer_init_mutex (&l, &m, LUMIERA_LOCKED); return 0; } diff --git a/tests/locking/test-condition.c b/tests/locking/test-condition.c index cc8e5ae14..1e3ca1bf7 100644 --- a/tests/locking/test-condition.c +++ b/tests/locking/test-condition.c @@ -24,7 +24,7 @@ #include "lib/condition.h" -CINELERRA_ERROR_DEFINE(TEST, "test error"); +LUMIERA_ERROR_DEFINE(TEST, "test error"); #if 0 waiting_thread() @@ -52,11 +52,11 @@ main (int argc, char** argv) if (!strcmp(argv[1], "conditionforgotunlock")) { - cinelerra_condition c; - cinelerra_condition_init (&c); + lumiera_condition c; + lumiera_condition_init (&c); - cinelerra_conditionlock NOBUG_CLEANUP(cinelerra_conditionlock_ensureunlocked) l; - cinelerra_conditionlock_init (&l, &c, CINELERRA_LOCKED); + lumiera_conditionlock NOBUG_CLEANUP(lumiera_conditionlock_ensureunlocked) l; + lumiera_conditionlock_init (&l, &c, LUMIERA_LOCKED); } else return 1; diff --git a/tests/locking/test-locking.c b/tests/locking/test-locking.c index 46455764b..1b54d152e 100644 --- a/tests/locking/test-locking.c +++ b/tests/locking/test-locking.c @@ -24,7 +24,7 @@ #include "lib/error.h" -CINELERRA_ERROR_DEFINE(TEST, "test error"); +LUMIERA_ERROR_DEFINE(TEST, "test error"); int conditionforgotunlock (); int mutexforgotunlock (); diff --git a/tests/plugin/example_plugin.c b/tests/plugin/example_plugin.c index ebb71ae8a..7540aa35d 100644 --- a/tests/plugin/example_plugin.c +++ b/tests/plugin/example_plugin.c @@ -34,12 +34,12 @@ void bye(const char* m) printf("Bye %s\n", m); } -CINELERRA_INTERFACE_IMPLEMENT(hello, 1, german, myopen, myclose, - hallo, - tschuess - ); +LUMIERA_INTERFACE_IMPLEMENT(hello, 1, german, myopen, myclose, + hallo, + tschuess + ); -CINELERRA_INTERFACE_IMPLEMENT(hello, 1, english, myopen, myclose, - hello, - bye - ); +LUMIERA_INTERFACE_IMPLEMENT(hello, 1, english, myopen, myclose, + hello, + bye + ); diff --git a/tests/plugin/example_plugin.cpp b/tests/plugin/example_plugin.cpp index b608887d8..aba34b44a 100644 --- a/tests/plugin/example_plugin.cpp +++ b/tests/plugin/example_plugin.cpp @@ -50,12 +50,12 @@ public: }; -CINELERRA_INTERFACE_IMPLEMENT(hello, 1, german, example_plugin_de::myopen, example_plugin_de::myclose, - example_plugin_de::hello, - example_plugin_de::bye - ); +LUMIERA_INTERFACE_IMPLEMENT(hello, 1, german, example_plugin_de::myopen, example_plugin_de::myclose, + example_plugin_de::hello, + example_plugin_de::bye + ); -CINELERRA_INTERFACE_IMPLEMENT(hello, 1, english, example_plugin_en::myopen, example_plugin_en::myclose, - example_plugin_en::hello, - example_plugin_en::bye - ); +LUMIERA_INTERFACE_IMPLEMENT(hello, 1, english, example_plugin_en::myopen, example_plugin_en::myclose, + example_plugin_en::hello, + example_plugin_en::bye + ); diff --git a/tests/plugin/hello_interface.h b/tests/plugin/hello_interface.h index ccec270ed..d5cf99ea5 100644 --- a/tests/plugin/hello_interface.h +++ b/tests/plugin/hello_interface.h @@ -1,6 +1,6 @@ #include "lib/plugin.h" -CINELERRA_INTERFACE(hello, 1, - CINELERRA_INTERFACE_PROTO(void, hello, (void)) - CINELERRA_INTERFACE_PROTO(void, goodbye, (const char*)) - ); +LUMIERA_INTERFACE(hello, 1, + LUMIERA_INTERFACE_PROTO(void, hello, (void)) + LUMIERA_INTERFACE_PROTO(void, goodbye, (const char*)) + ); diff --git a/tests/plugin/plugin_main.c b/tests/plugin/plugin_main.c index e691438b3..2efe32471 100644 --- a/tests/plugin/plugin_main.c +++ b/tests/plugin/plugin_main.c @@ -12,7 +12,7 @@ main(int argc, char** argv) if (argc < 2) return -1; - cinelerra_init_plugin (); + lumiera_init_plugin (); /* we have a plugin 'hello_1' which provides us 2 hello interfaces, one for english and one for german output, open both try them, close them. @@ -22,47 +22,47 @@ main(int argc, char** argv) if( !strcmp(argv[1],"C")) { - CINELERRA_INTERFACE_TYPE(hello, 1)* hello_de = - (CINELERRA_INTERFACE_TYPE(hello, 1)*) cinelerra_interface_open ("example_plugin", "german_1", sizeof(CINELERRA_INTERFACE_TYPE(hello, 1))); + LUMIERA_INTERFACE_TYPE(hello, 1)* hello_de = + (LUMIERA_INTERFACE_TYPE(hello, 1)*) lumiera_interface_open ("example_plugin", "german_1", sizeof(LUMIERA_INTERFACE_TYPE(hello, 1))); - if (!hello_de) CINELERRA_DIE; + if (!hello_de) LUMIERA_DIE; hello_de->hello(); hello_de->goodbye(argv[1]); - CINELERRA_INTERFACE_TYPE(hello, 1)* hello_en = - (CINELERRA_INTERFACE_TYPE(hello, 1)*) cinelerra_interface_open ("example_plugin", "english_1", sizeof(CINELERRA_INTERFACE_TYPE(hello, 1))); + LUMIERA_INTERFACE_TYPE(hello, 1)* hello_en = + (LUMIERA_INTERFACE_TYPE(hello, 1)*) lumiera_interface_open ("example_plugin", "english_1", sizeof(LUMIERA_INTERFACE_TYPE(hello, 1))); - if (!hello_en) CINELERRA_DIE; + if (!hello_en) LUMIERA_DIE; hello_en->hello(); hello_en->goodbye(argv[1]); - cinelerra_interface_close (hello_en); - cinelerra_interface_close (hello_de); + lumiera_interface_close (hello_en); + lumiera_interface_close (hello_de); } if( !strcmp(argv[1],"C++")) { /* same again for a plugin written in C++ */ - CINELERRA_INTERFACE_TYPE(hello, 1)* hello_de = - (CINELERRA_INTERFACE_TYPE(hello, 1)*) cinelerra_interface_open ("example_plugin_cpp", "german_1", sizeof(CINELERRA_INTERFACE_TYPE(hello, 1))); + LUMIERA_INTERFACE_TYPE(hello, 1)* hello_de = + (LUMIERA_INTERFACE_TYPE(hello, 1)*) lumiera_interface_open ("example_plugin_cpp", "german_1", sizeof(LUMIERA_INTERFACE_TYPE(hello, 1))); - if (!hello_de) CINELERRA_DIE; + if (!hello_de) LUMIERA_DIE; hello_de->hello(); hello_de->goodbye(argv[1]); - CINELERRA_INTERFACE_TYPE(hello, 1)* hello_en = - (CINELERRA_INTERFACE_TYPE(hello, 1)*) cinelerra_interface_open ("example_plugin_cpp", "english_1", sizeof(CINELERRA_INTERFACE_TYPE(hello, 1))); + LUMIERA_INTERFACE_TYPE(hello, 1)* hello_en = + (LUMIERA_INTERFACE_TYPE(hello, 1)*) lumiera_interface_open ("example_plugin_cpp", "english_1", sizeof(LUMIERA_INTERFACE_TYPE(hello, 1))); - if (!hello_en) CINELERRA_DIE; + if (!hello_en) LUMIERA_DIE; hello_en->hello(); hello_en->goodbye(argv[1]); - cinelerra_interface_close (hello_en); - cinelerra_interface_close (hello_de); + lumiera_interface_close (hello_en); + lumiera_interface_close (hello_de); } return 0; diff --git a/tests/time/test-time.c b/tests/time/test-time.c index 01dd107ef..e9d8d0550 100644 --- a/tests/time/test-time.c +++ b/tests/time/test-time.c @@ -26,7 +26,7 @@ #include "lib/framerate.h" -CINELERRA_ERROR_DEFINE(TEST, "test error"); +LUMIERA_ERROR_DEFINE(TEST, "test error"); int main (int argc, char** argv) @@ -38,106 +38,106 @@ main (int argc, char** argv) if (!strcmp(argv[1], "init")) { - cinelerra_time time; + lumiera_time time; - cinelerra_time_init (&time, atol (argv[2]), atol(argv[3])); + lumiera_time_init (&time, atol (argv[2]), atol(argv[3])); - printf ("%lu %lu\n", (long)cinelerra_time_sec (&time), (long)cinelerra_time_usec (&time)); + printf ("%lu %lu\n", (long)lumiera_time_sec (&time), (long)lumiera_time_usec (&time)); } if (!strcmp(argv[1], "todouble")) { - cinelerra_time time; + lumiera_time time; - cinelerra_time_init (&time, atol (argv[2]), atol(argv[3])); + lumiera_time_init (&time, atol (argv[2]), atol(argv[3])); - printf ("%g\n", cinelerra_time_double_get (&time)); + printf ("%g\n", lumiera_time_double_get (&time)); } if (!strcmp(argv[1], "todoublenull")) { - printf ("%g\n", cinelerra_time_double_get (NULL)); + printf ("%g\n", lumiera_time_double_get (NULL)); } if (!strcmp(argv[1], "fromdouble")) { - cinelerra_time time; + lumiera_time time; - cinelerra_time_set_double (&time, atof (argv[2])); + lumiera_time_set_double (&time, atof (argv[2])); - printf ("%lu %lu\n", (long)cinelerra_time_sec (&time), (long)cinelerra_time_usec (&time)); + printf ("%lu %lu\n", (long)lumiera_time_sec (&time), (long)lumiera_time_usec (&time)); } if (!strcmp(argv[1], "currenttime")) { - cinelerra_time time; + lumiera_time time; - cinelerra_time_current (&time); + lumiera_time_current (&time); - printf ("%lu %lu\n", (long)cinelerra_time_sec (&time), (long)cinelerra_time_usec (&time)); + printf ("%lu %lu\n", (long)lumiera_time_sec (&time), (long)lumiera_time_usec (&time)); } if (!strcmp(argv[1], "add")) { - cinelerra_time time1, time2; + lumiera_time time1, time2; - cinelerra_time_init (&time1, 0, atol (argv[2])); - cinelerra_time_init (&time2, 0, atol (argv[3])); - cinelerra_time_add (&time1, &time2); + lumiera_time_init (&time1, 0, atol (argv[2])); + lumiera_time_init (&time2, 0, atol (argv[3])); + lumiera_time_add (&time1, &time2); - printf ("%lu %lu\n", (long)cinelerra_time_sec (&time1), (long)cinelerra_time_usec (&time1)); + printf ("%lu %lu\n", (long)lumiera_time_sec (&time1), (long)lumiera_time_usec (&time1)); } if (!strcmp(argv[1], "sub")) { - cinelerra_time time1, time2; + lumiera_time time1, time2; - cinelerra_time_init (&time1, 0, atol (argv[2])); - cinelerra_time_init (&time2, 0, atol (argv[3])); - cinelerra_time_sub (&time1, &time2); + lumiera_time_init (&time1, 0, atol (argv[2])); + lumiera_time_init (&time2, 0, atol (argv[3])); + lumiera_time_sub (&time1, &time2); - printf ("%lu %lu\n", (long)cinelerra_time_sec (&time1), (long)cinelerra_time_usec (&time1)); + printf ("%lu %lu\n", (long)lumiera_time_sec (&time1), (long)lumiera_time_usec (&time1)); } if (!strcmp(argv[1], "ntscframefromtime")) { - cinelerra_framerate ntsc = {30000, 1001}; - cinelerra_time time; + lumiera_framerate ntsc = {30000, 1001}; + lumiera_time time; - cinelerra_time_init (&time, atol (argv[2]), atol (argv[3])); + lumiera_time_init (&time, atol (argv[2]), atol (argv[3])); - printf ("%lu\n", (long)cinelerra_framerate_frame_get_time (&ntsc, &time)); + printf ("%lu\n", (long)lumiera_framerate_frame_get_time (&ntsc, &time)); } if (!strcmp(argv[1], "ntscframestart")) { - cinelerra_framerate ntsc = {30000, 1001}; - cinelerra_time time; + lumiera_framerate ntsc = {30000, 1001}; + lumiera_time time; - if(cinelerra_framerate_time_get_time_frame (&ntsc, &time, atol (argv[2]))) - printf ("%lu %lu\n", (long)cinelerra_time_sec(&time), (long)cinelerra_time_usec(&time)); + if(lumiera_framerate_time_get_time_frame (&ntsc, &time, atol (argv[2]))) + printf ("%lu %lu\n", (long)lumiera_time_sec(&time), (long)lumiera_time_usec(&time)); } if (!strcmp(argv[1], "ntscframecheck")) { - cinelerra_framerate ntsc = {30000, 1001}; - cinelerra_time time1; - cinelerra_time time2; - cinelerra_framepos frame; + lumiera_framerate ntsc = {30000, 1001}; + lumiera_time time1; + lumiera_time time2; + lumiera_framepos frame; - cinelerra_framepos frame1; - cinelerra_framepos frame2; + lumiera_framepos frame1; + lumiera_framepos frame2; frame = atol (argv[2]); - if (cinelerra_framerate_time_get_time_frame (&ntsc, &time1, frame)) + if (lumiera_framerate_time_get_time_frame (&ntsc, &time1, frame)) { - printf("frame %lu ", frame1 = cinelerra_framerate_frame_get_time (&ntsc, &time1)); + printf("frame %lu ", frame1 = lumiera_framerate_frame_get_time (&ntsc, &time1)); - cinelerra_time_init (&time2, 0, 1); - cinelerra_time_sub (&time1, &time2); - printf("%lu\n", frame2 = cinelerra_framerate_frame_get_time (&ntsc, &time1)); + lumiera_time_init (&time2, 0, 1); + lumiera_time_sub (&time1, &time2); + printf("%lu\n", frame2 = lumiera_framerate_frame_get_time (&ntsc, &time1)); ENSURE (frame1 == frame2+1); } From 912b4993fcca65b2a3666b7f0ac3b8207508beab Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Thu, 10 Apr 2008 15:36:21 +0100 Subject: [PATCH 004/110] Created empty UI window --- gui/configure.ac | 2 +- gui/src/Makefile.am | 5 ++++- gui/src/gtk-lumiera.h | 27 +++++++++++++++++++++++++++ gui/src/main-window.cpp | 39 +++++++++++++++++++++++++++++++++++++++ gui/src/main-window.h | 29 +++++++++++++++++++++++++++++ gui/src/main.cpp | 35 +++++++++-------------------------- 6 files changed, 109 insertions(+), 28 deletions(-) create mode 100644 gui/src/gtk-lumiera.h create mode 100644 gui/src/main-window.cpp create mode 100644 gui/src/main-window.h diff --git a/gui/configure.ac b/gui/configure.ac index 9eef896f8..0bc4740c9 100644 --- a/gui/configure.ac +++ b/gui/configure.ac @@ -30,7 +30,7 @@ AM_PROG_LIBTOOL -PKG_CHECK_MODULES(GTK_LUMIERA, [gtkmm-2.4 >= 2.8 libglademm-2.4 >= 2.6 ]) +PKG_CHECK_MODULES(GTK_LUMIERA, [gtkmm-2.4 >= 2.8 libglademm-2.4 >= 2.6 gdl-1.0 >= 0.2.6]) AC_SUBST(GTK_LUMIERA_CFLAGS) AC_SUBST(GTK_LUMIERA_LIBS) diff --git a/gui/src/Makefile.am b/gui/src/Makefile.am index 7ae61d803..a47247986 100644 --- a/gui/src/Makefile.am +++ b/gui/src/Makefile.am @@ -18,7 +18,10 @@ AM_CFLAGS =\ bin_PROGRAMS = gtk-lumiera gtk_lumiera_SOURCES = \ - main.cpp + main.cpp \ + main-window.cpp \ + main-window.h \ + gtk-lumiera.h gtk_lumiera_LDFLAGS = diff --git a/gui/src/gtk-lumiera.h b/gui/src/gtk-lumiera.h new file mode 100644 index 000000000..1b69d5521 --- /dev/null +++ b/gui/src/gtk-lumiera.h @@ -0,0 +1,27 @@ +/* + * 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 Library 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., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA + */ + +#ifdef ENABLE_NLS +# include +# define _(String) gettext (String) +# define gettext_noop(String) String +# define N_(String) gettext_noop (String) +#else +# define _(String) (String) +# define N_(String) String +# define textdomain(Domain) +# define bindtextdomain(Package, Directory) +#endif diff --git a/gui/src/main-window.cpp b/gui/src/main-window.cpp new file mode 100644 index 000000000..e0984f238 --- /dev/null +++ b/gui/src/main-window.cpp @@ -0,0 +1,39 @@ +// main-window.cpp +// Tue Apr 8 23:54:36 2008 +// Copyright 2008 joel +// > + +// 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 3 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 Library 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., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA + +#include + +#ifdef ENABLE_NLS +# include +#endif + +#include "gtk-lumiera.h" +#include "main-window.h" + +namespace Lumiera { +namespace UI { + +MainWindow::MainWindow() +{ + set_title(_("Lumiera")); + set_default_size(1024, 768); +} + +} +} diff --git a/gui/src/main-window.h b/gui/src/main-window.h new file mode 100644 index 000000000..8d916eb1f --- /dev/null +++ b/gui/src/main-window.h @@ -0,0 +1,29 @@ +/* + * 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 3 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 Library 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., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA + */ + +#include + +namespace Lumiera { +namespace UI { + +class MainWindow : public Gtk::Window +{ +public: + MainWindow(); +}; + +} +} diff --git a/gui/src/main.cpp b/gui/src/main.cpp index bb69eb3d9..aa3a9f0a3 100644 --- a/gui/src/main.cpp +++ b/gui/src/main.cpp @@ -1,6 +1,6 @@ /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */ /* - * main.cc + * main.cpp * Copyright (C) Joel Holdsworth 2008 * * main.cc is free software. @@ -22,41 +22,24 @@ * Boston, MA 02110-1301, USA. */ -#include #include #include - #ifdef ENABLE_NLS # include #endif +#include "main-window.h" -/* For testing propose use the local (not installed) glade file */ -/* #define GLADE_FILE PACKAGE_DATA_DIR"/gtk-lumiera/glade/gtk-lumiera.glade" */ -#define GLADE_FILE "gtk-lumiera.glade" - -int -main (int argc, char *argv[]) +using namespace Lumiera::UI; + +int main (int argc, char *argv[]) { Gtk::Main kit(argc, argv); - //Load the Glade file and instiate its widgets: - Glib::RefPtr refXml; - try - { - refXml = Gnome::Glade::Xml::create(GLADE_FILE); - } - catch(const Gnome::Glade::XmlError& ex) - { - std::cerr << ex.what() << std::endl; - return 1; - } - Gtk::Window* main_win = 0; - refXml->get_widget("main_window", main_win); - if (main_win) - { - kit.run(*main_win); - } + MainWindow main_window; + + kit.run(main_window); + return 0; } From 6f5c701c5735e3bf9d144a1d90574c5d996f8f85 Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Fri, 11 Apr 2008 20:28:15 +0100 Subject: [PATCH 005/110] Created workscape namespace --- gui/src/Makefile.am | 16 ++- gui/src/{gtk-lumiera.h => gtk-lumiera.hpp} | 2 + gui/src/main-window.cpp | 39 ------ gui/src/main.cpp | 9 +- gui/src/workspace/actions.cpp | 121 ++++++++++++++++++ gui/src/workspace/actions.hpp | 61 +++++++++ gui/src/workspace/mainwindow.cpp | 121 ++++++++++++++++++ .../mainwindow.hpp} | 26 +++- 8 files changed, 342 insertions(+), 53 deletions(-) rename gui/src/{gtk-lumiera.h => gtk-lumiera.hpp} (96%) delete mode 100644 gui/src/main-window.cpp create mode 100644 gui/src/workspace/actions.cpp create mode 100644 gui/src/workspace/actions.hpp create mode 100644 gui/src/workspace/mainwindow.cpp rename gui/src/{main-window.h => workspace/mainwindow.hpp} (68%) diff --git a/gui/src/Makefile.am b/gui/src/Makefile.am index a47247986..a2ef821b3 100644 --- a/gui/src/Makefile.am +++ b/gui/src/Makefile.am @@ -1,7 +1,5 @@ ## Process this file with automake to produce Makefile.in -## Created by Anjuta - gladedir = $(datadir)/gtk-lumiera/glade glade_DATA = gtk-lumiera.glade @@ -17,14 +15,18 @@ AM_CFLAGS =\ bin_PROGRAMS = gtk-lumiera -gtk_lumiera_SOURCES = \ - main.cpp \ - main-window.cpp \ - main-window.h \ - gtk-lumiera.h +gtk_lumiera_SOURCES = \ + main.cpp \ + gtk-lumiera.hpp \ + workspace/actions.cpp \ + workspace/actions.hpp \ + workspace/mainwindow.cpp \ + workspace/mainwindow.hpp gtk_lumiera_LDFLAGS = gtk_lumiera_LDADD = $(GTK_LUMIERA_LIBS) EXTRA_DIST = $(glade_DATA) + + diff --git a/gui/src/gtk-lumiera.h b/gui/src/gtk-lumiera.hpp similarity index 96% rename from gui/src/gtk-lumiera.h rename to gui/src/gtk-lumiera.hpp index 1b69d5521..e8b9eed6a 100644 --- a/gui/src/gtk-lumiera.h +++ b/gui/src/gtk-lumiera.hpp @@ -25,3 +25,5 @@ # define textdomain(Domain) # define bindtextdomain(Package, Directory) #endif + +const gchar* AppTitle = N_("Lumiera"); diff --git a/gui/src/main-window.cpp b/gui/src/main-window.cpp deleted file mode 100644 index e0984f238..000000000 --- a/gui/src/main-window.cpp +++ /dev/null @@ -1,39 +0,0 @@ -// main-window.cpp -// Tue Apr 8 23:54:36 2008 -// Copyright 2008 joel -// > - -// 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 3 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 Library 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., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA - -#include - -#ifdef ENABLE_NLS -# include -#endif - -#include "gtk-lumiera.h" -#include "main-window.h" - -namespace Lumiera { -namespace UI { - -MainWindow::MainWindow() -{ - set_title(_("Lumiera")); - set_default_size(1024, 768); -} - -} -} diff --git a/gui/src/main.cpp b/gui/src/main.cpp index aa3a9f0a3..9c9298ebf 100644 --- a/gui/src/main.cpp +++ b/gui/src/main.cpp @@ -29,13 +29,16 @@ # include #endif -#include "main-window.h" +#include "workspace/mainwindow.hpp" -using namespace Lumiera::UI; +using namespace Lumiera::Workspace; +using namespace Gtk; int main (int argc, char *argv[]) { - Gtk::Main kit(argc, argv); + Main kit(argc, argv); + + Glib::set_application_name("UIManager example"); MainWindow main_window; diff --git a/gui/src/workspace/actions.cpp b/gui/src/workspace/actions.cpp new file mode 100644 index 000000000..1fc1f3a9f --- /dev/null +++ b/gui/src/workspace/actions.cpp @@ -0,0 +1,121 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */ +/* + * gui + * Copyright (C) 2008 <> + * + * gui is free software. + * + * You may 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. + * + * gui 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 gui. If not, write to: + * The Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor + * Boston, MA 02110-1301, USA. + */ + +#include "actions.hpp" +#include "mainwindow.hpp" + +namespace Lumiera { +namespace Workspace { + +Actions::Actions(MainWindow &main_window) : + _main_window(main_window) +{ + _action_group = Gtk::ActionGroup::create(); + + // File|New sub menu: + _action_group->add(Gtk::Action::create("FileNewStandard", + Gtk::Stock::NEW, "_New", "Create a new file"), + sigc::mem_fun(*this, &Actions::on_menu_file_new_generic)); + + _action_group->add(Gtk::Action::create("FileNewFoo", + Gtk::Stock::NEW, "New Foo", "Create a new foo"), + sigc::mem_fun(*this, &Actions::on_menu_file_new_generic)); + + _action_group->add(Gtk::Action::create("FileNewGoo", + Gtk::Stock::NEW, "_New Goo", "Create a new goo"), + sigc::mem_fun(*this, &Actions::on_menu_file_new_generic)); + + // File menu: + _action_group->add(Gtk::Action::create("FileMenu", "File")); + // Sub-menu. + _action_group->add(Gtk::Action::create("FileNew", Gtk::Stock::NEW)); + _action_group->add(Gtk::Action::create("FileQuit", Gtk::Stock::QUIT), + sigc::mem_fun(*this, &Actions::on_menu_file_quit)); + + // Edit menu: + _action_group->add(Gtk::Action::create("EditMenu", "Edit")); + _action_group->add(Gtk::Action::create("EditCopy", Gtk::Stock::COPY), + sigc::mem_fun(*this, &Actions::on_menu_others)); + _action_group->add(Gtk::Action::create("EditPaste", Gtk::Stock::PASTE), + sigc::mem_fun(*this, &Actions::on_menu_others)); + _action_group->add(Gtk::Action::create("EditSomething", "Something"), + Gtk::AccelKey("S"), + sigc::mem_fun(*this, &Actions::on_menu_others)); + + // Choices menu, to demonstrate Radio items + _action_group->add( Gtk::Action::create("ChoicesMenu", "Choices") ); + Gtk::RadioAction::Group group_userlevel; + m_refChoiceOne = Gtk::RadioAction::create(group_userlevel, "ChoiceOne", "One"); + _action_group->add(m_refChoiceOne, + sigc::mem_fun(*this, &Actions::on_menu_choices_one) ); + m_refChoiceTwo = Gtk::RadioAction::create(group_userlevel, "ChoiceTwo", "Two"); + _action_group->add(m_refChoiceTwo, + sigc::mem_fun(*this, &Actions::on_menu_choices_two) ); + + // Help menu: + _action_group->add( Gtk::Action::create("HelpMenu", "Help") ); + _action_group->add( Gtk::Action::create("HelpAbout", Gtk::Stock::HELP), + sigc::mem_fun(*this, &Actions::on_menu_others) ); +} + +void Actions::on_menu_file_quit() +{ + _main_window.hide(); // Closes the main window to stop the Gtk::Main::run(). +} + +void Actions::on_menu_file_new_generic() +{ + g_message("A File|New menu item was selecteda."); +} + +void Actions::on_menu_others() +{ + g_message("A menu item was selected."); +} + +void Actions::on_menu_choices_one() +{ + Glib::ustring message; + //if(m_refChoiceOne->get_active()) + // message = "Choice 1 was selected."; + //else + message = "Choice 1 was deselected"; + + g_message(message.c_str()); +} + +void Actions::on_menu_choices_two() +{ + Glib::ustring message; + //if(_main_window.m_refChoiceTwo->get_active()) + // message = "Choice 2 was selected."; + //else + message = "Choice 2 was deselected"; + + g_message(message.c_str()); +} + +} // namespace Workspace +} // namespace Lumiera + diff --git a/gui/src/workspace/actions.hpp b/gui/src/workspace/actions.hpp new file mode 100644 index 000000000..787c5a376 --- /dev/null +++ b/gui/src/workspace/actions.hpp @@ -0,0 +1,61 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */ +/* + * gui + * Copyright (C) 2008 <> + * + * gui is free software. + * + * You may 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. + * + * gui 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 gui. If not, write to: + * The Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor + * Boston, MA 02110-1301, USA. + */ + +#ifndef ACTIONS_H +#define ACTIONS_H + +#include + +namespace Lumiera { +namespace Workspace { + +class MainWindow; + +class Actions +{ +private: + Actions(MainWindow &main_window); + + //----- Event Handlers -----// + void on_menu_file_new_generic(); + void on_menu_file_quit(); + void on_menu_others(); + + void on_menu_choices_one(); + void on_menu_choices_two(); + + //----- Actions -----// + Glib::RefPtr _action_group; + Glib::RefPtr m_refChoiceOne, m_refChoiceTwo; + + // Reference to the main window + MainWindow &_main_window; + + friend class MainWindow; +}; + +} // namespace Workspace +} // namespace Lumiera + +#endif // ACTIONS_H diff --git a/gui/src/workspace/mainwindow.cpp b/gui/src/workspace/mainwindow.cpp new file mode 100644 index 000000000..79eea3a2b --- /dev/null +++ b/gui/src/workspace/mainwindow.cpp @@ -0,0 +1,121 @@ +// main-window.cpp +// Tue Apr 8 23:54:36 2008 +// Copyright 2008 joel +// + +// 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 3 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 Library 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., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA + +#include + +#ifdef ENABLE_NLS +# include +#endif + +#include "gtk-lumiera.hpp" +#include "mainwindow.hpp" + +namespace Lumiera { +namespace Workspace { + +MainWindow::MainWindow() + : _actions(*this) +{ + create_ui(); +} + +MainWindow::~MainWindow() +{ +} + +void MainWindow::create_ui() +{ + //----- Configure the Window -----// + set_title(AppTitle); + set_default_size(1024, 768); + + // The UI will be nested within a VBOX + add(_box); + + m_refUIManager = Gtk::UIManager::create(); + m_refUIManager->insert_action_group(_actions._action_group); + + add_accel_group(m_refUIManager->get_accel_group()); + + //Layout the actions in a menubar and toolbar: + Glib::ustring ui_info = + "" + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + ""; + +#ifdef GLIBMM_EXCEPTIONS_ENABLED + try + { + m_refUIManager->add_ui_from_string(ui_info); + } + catch(const Glib::Error& ex) + { + g_error("building menus failed: "); + return; + } +#else + std::auto_ptr ex; + m_refUIManager->add_ui_from_string(ui_info, ex); + if(ex.get()) + { + g_error("building menus failed: "); + return; + } +#endif //GLIBMM_EXCEPTIONS_ENABLED + + // Get the menubar and toolbar widgets, and add them to a container widget: + Gtk::Widget* pMenubar = m_refUIManager->get_widget("/MenuBar"); + if(pMenubar) + _box.pack_start(*pMenubar, Gtk::PACK_SHRINK); + + Gtk::Widget* pToolbar = m_refUIManager->get_widget("/ToolBar") ; + if(pToolbar) + _box.pack_start(*pToolbar, Gtk::PACK_SHRINK); + + show_all_children(); +} + +} // namespace Workspace +} // namespace Lumiera + diff --git a/gui/src/main-window.h b/gui/src/workspace/mainwindow.hpp similarity index 68% rename from gui/src/main-window.h rename to gui/src/workspace/mainwindow.hpp index 8d916eb1f..7beab8783 100644 --- a/gui/src/main-window.h +++ b/gui/src/workspace/mainwindow.hpp @@ -14,16 +14,34 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA */ -#include +#ifndef MAIN_WINDOW_H +#define MAIN_WINDOW_H + +#include +#include "actions.hpp" namespace Lumiera { -namespace UI { +namespace Workspace { class MainWindow : public Gtk::Window { public: MainWindow(); + virtual ~MainWindow(); + +protected: + void create_ui(); + + // Helpers + Actions _actions; + + // Child widgets + Gtk::VBox _box; + + Glib::RefPtr m_refUIManager; }; -} -} +} // namespace Workspace +} // namespace Lumiera + +#endif // MAIN_WINDOW_H From bd0e634a27882642c65775fa297b1600dfd8bc61 Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Fri, 11 Apr 2008 22:04:39 +0100 Subject: [PATCH 006/110] Reformatted code to comply with project format guidlines, and added some documentation --- gui/src/gtk-lumiera.hpp | 49 ++++++++---- gui/src/main.cpp | 59 +++++++------- gui/src/workspace/actions.cpp | 129 ++++++++++++++++--------------- gui/src/workspace/actions.hpp | 98 ++++++++++++----------- gui/src/workspace/mainwindow.cpp | 98 +++++++++++------------ gui/src/workspace/mainwindow.hpp | 85 ++++++++++++-------- 6 files changed, 290 insertions(+), 228 deletions(-) diff --git a/gui/src/gtk-lumiera.hpp b/gui/src/gtk-lumiera.hpp index e8b9eed6a..97eb98744 100644 --- a/gui/src/gtk-lumiera.hpp +++ b/gui/src/gtk-lumiera.hpp @@ -1,18 +1,32 @@ /* - * 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 Library 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., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA + gtk-lumiera.hpp - Application wide global definitions + + Copyright (C) Lumiera.org + 2008, Joel Holdsworth + + 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. + +*/ +/** @file gtk-lumiera.hpp + ** This file contains application wide global definitions + ** user actions. + ** @see main.cpp */ + +#ifndef GTK_LUMIERA_HPP +#define GTK_LUMIERA_HPO #ifdef ENABLE_NLS # include @@ -26,4 +40,11 @@ # define bindtextdomain(Package, Directory) #endif -const gchar* AppTitle = N_("Lumiera"); +/** + * The name of the Lumiera application + */ +static const gchar* AppTitle = N_("Lumiera"); + +#endif + + diff --git a/gui/src/main.cpp b/gui/src/main.cpp index 9c9298ebf..9b191fc1e 100644 --- a/gui/src/main.cpp +++ b/gui/src/main.cpp @@ -1,26 +1,24 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */ /* - * main.cpp - * Copyright (C) Joel Holdsworth 2008 - * - * main.cc is free software. - * - * You may 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. - * - * main.cc 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 main.cc. If not, write to: - * The Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor - * Boston, MA 02110-1301, USA. - */ + Main.cpp - The entry point for the GTK GUI application + + Copyright (C) Lumiera.org + 2008, Joel Holdsworth + + 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 #include @@ -29,20 +27,27 @@ # include #endif +#include "gtk-lumiera.hpp" #include "workspace/mainwindow.hpp" -using namespace Lumiera::Workspace; + +//const gchar* AppTitle +//const gchar AppTitle[] = N_("Lumiera"); + +using namespace lumiera::workspace; using namespace Gtk; -int main (int argc, char *argv[]) -{ + int + main (int argc, char *argv[]) + { Main kit(argc, argv); - Glib::set_application_name("UIManager example"); + Glib::set_application_name(AppTitle); MainWindow main_window; kit.run(main_window); return 0; -} + } + diff --git a/gui/src/workspace/actions.cpp b/gui/src/workspace/actions.cpp index 1fc1f3a9f..801140ecc 100644 --- a/gui/src/workspace/actions.cpp +++ b/gui/src/workspace/actions.cpp @@ -1,101 +1,105 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */ /* - * gui - * Copyright (C) 2008 <> - * - * gui is free software. - * - * You may 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. - * - * gui 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 gui. If not, write to: - * The Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor - * Boston, MA 02110-1301, USA. - */ + Actions.cpp - Definition of the main workspace window object + + Copyright (C) Lumiera.org + 2008, Joel Holdsworth + + 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 "actions.hpp" #include "mainwindow.hpp" -namespace Lumiera { -namespace Workspace { +namespace lumiera + { +namespace workspace + { -Actions::Actions(MainWindow &main_window) : - _main_window(main_window) -{ - _action_group = Gtk::ActionGroup::create(); + Actions::Actions(MainWindow &main_window) : + mainWindow(main_window) + { + actionGroup = Gtk::ActionGroup::create(); // File|New sub menu: - _action_group->add(Gtk::Action::create("FileNewStandard", + actionGroup->add(Gtk::Action::create("FileNewStandard", Gtk::Stock::NEW, "_New", "Create a new file"), sigc::mem_fun(*this, &Actions::on_menu_file_new_generic)); - _action_group->add(Gtk::Action::create("FileNewFoo", + actionGroup->add(Gtk::Action::create("FileNewFoo", Gtk::Stock::NEW, "New Foo", "Create a new foo"), sigc::mem_fun(*this, &Actions::on_menu_file_new_generic)); - _action_group->add(Gtk::Action::create("FileNewGoo", + actionGroup->add(Gtk::Action::create("FileNewGoo", Gtk::Stock::NEW, "_New Goo", "Create a new goo"), sigc::mem_fun(*this, &Actions::on_menu_file_new_generic)); // File menu: - _action_group->add(Gtk::Action::create("FileMenu", "File")); + actionGroup->add(Gtk::Action::create("FileMenu", "File")); // Sub-menu. - _action_group->add(Gtk::Action::create("FileNew", Gtk::Stock::NEW)); - _action_group->add(Gtk::Action::create("FileQuit", Gtk::Stock::QUIT), + actionGroup->add(Gtk::Action::create("FileNew", Gtk::Stock::NEW)); + actionGroup->add(Gtk::Action::create("FileQuit", Gtk::Stock::QUIT), sigc::mem_fun(*this, &Actions::on_menu_file_quit)); // Edit menu: - _action_group->add(Gtk::Action::create("EditMenu", "Edit")); - _action_group->add(Gtk::Action::create("EditCopy", Gtk::Stock::COPY), + actionGroup->add(Gtk::Action::create("EditMenu", "Edit")); + actionGroup->add(Gtk::Action::create("EditCopy", Gtk::Stock::COPY), sigc::mem_fun(*this, &Actions::on_menu_others)); - _action_group->add(Gtk::Action::create("EditPaste", Gtk::Stock::PASTE), + actionGroup->add(Gtk::Action::create("EditPaste", Gtk::Stock::PASTE), sigc::mem_fun(*this, &Actions::on_menu_others)); - _action_group->add(Gtk::Action::create("EditSomething", "Something"), + actionGroup->add(Gtk::Action::create("EditSomething", "Something"), Gtk::AccelKey("S"), sigc::mem_fun(*this, &Actions::on_menu_others)); // Choices menu, to demonstrate Radio items - _action_group->add( Gtk::Action::create("ChoicesMenu", "Choices") ); + actionGroup->add( Gtk::Action::create("ChoicesMenu", "Choices") ); Gtk::RadioAction::Group group_userlevel; m_refChoiceOne = Gtk::RadioAction::create(group_userlevel, "ChoiceOne", "One"); - _action_group->add(m_refChoiceOne, + actionGroup->add(m_refChoiceOne, sigc::mem_fun(*this, &Actions::on_menu_choices_one) ); m_refChoiceTwo = Gtk::RadioAction::create(group_userlevel, "ChoiceTwo", "Two"); - _action_group->add(m_refChoiceTwo, + actionGroup->add(m_refChoiceTwo, sigc::mem_fun(*this, &Actions::on_menu_choices_two) ); // Help menu: - _action_group->add( Gtk::Action::create("HelpMenu", "Help") ); - _action_group->add( Gtk::Action::create("HelpAbout", Gtk::Stock::HELP), + actionGroup->add( Gtk::Action::create("HelpMenu", "Help") ); + actionGroup->add( Gtk::Action::create("HelpAbout", Gtk::Stock::HELP), sigc::mem_fun(*this, &Actions::on_menu_others) ); -} + } -void Actions::on_menu_file_quit() -{ - _main_window.hide(); // Closes the main window to stop the Gtk::Main::run(). -} + void + Actions::on_menu_file_quit() + { + mainWindow.hide(); // Closes the main window to stop the Gtk::Main::run(). + } -void Actions::on_menu_file_new_generic() -{ + void + Actions::on_menu_file_new_generic() + { g_message("A File|New menu item was selecteda."); -} + } -void Actions::on_menu_others() -{ + void + Actions::on_menu_others() + { g_message("A menu item was selected."); -} + } -void Actions::on_menu_choices_one() -{ + void + Actions::on_menu_choices_one() + { Glib::ustring message; //if(m_refChoiceOne->get_active()) // message = "Choice 1 was selected."; @@ -103,10 +107,11 @@ void Actions::on_menu_choices_one() message = "Choice 1 was deselected"; g_message(message.c_str()); -} + } -void Actions::on_menu_choices_two() -{ + void + Actions::on_menu_choices_two() + { Glib::ustring message; //if(_main_window.m_refChoiceTwo->get_active()) // message = "Choice 2 was selected."; @@ -114,8 +119,8 @@ void Actions::on_menu_choices_two() message = "Choice 2 was deselected"; g_message(message.c_str()); -} + } -} // namespace Workspace -} // namespace Lumiera +} // namespace workspace +} // namespace lumiera diff --git a/gui/src/workspace/actions.hpp b/gui/src/workspace/actions.hpp index 787c5a376..ec8abe3bc 100644 --- a/gui/src/workspace/actions.hpp +++ b/gui/src/workspace/actions.hpp @@ -1,61 +1,71 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */ /* - * gui - * Copyright (C) 2008 <> - * - * gui is free software. - * - * You may 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. - * - * gui 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 gui. If not, write to: - * The Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor - * Boston, MA 02110-1301, USA. + ACTIONS.hpp - Definition of a helper class for user actions + + Copyright (C) Lumiera.org + 2008, Joel Holdsworth + + 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. + +*/ +/** @file actions.hpp + ** This file contains the definition of a helper class for the + ** main workspace window object, which registers and handles + ** user actions. + ** @see mainwindow.hpp */ -#ifndef ACTIONS_H -#define ACTIONS_H +#ifndef ACTIONS_HPP +#define ACTIONS_HPP #include -namespace Lumiera { -namespace Workspace { +namespace lumiera { +namespace workspace { class MainWindow; -class Actions -{ -private: - Actions(MainWindow &main_window); + /** + * A helper class which registers and handles + * user action events. + */ + class Actions + { + private: + Actions(MainWindow &main_window); - //----- Event Handlers -----// - void on_menu_file_new_generic(); - void on_menu_file_quit(); - void on_menu_others(); + /** + * A reference to the MainWindow which owns + * this helper */ + MainWindow &mainWindow; - void on_menu_choices_one(); - void on_menu_choices_two(); + /* ===== Event Handlers ===== */ + void on_menu_file_new_generic(); + void on_menu_file_quit(); + void on_menu_others(); - //----- Actions -----// - Glib::RefPtr _action_group; - Glib::RefPtr m_refChoiceOne, m_refChoiceTwo; + void on_menu_choices_one(); + void on_menu_choices_two(); - // Reference to the main window - MainWindow &_main_window; + /* ===== Actions ===== */ + Glib::RefPtr actionGroup; + Glib::RefPtr m_refChoiceOne, m_refChoiceTwo; - friend class MainWindow; -}; + friend class MainWindow; + }; -} // namespace Workspace -} // namespace Lumiera +} // namespace workspace +} // namespace lumiera #endif // ACTIONS_H diff --git a/gui/src/workspace/mainwindow.cpp b/gui/src/workspace/mainwindow.cpp index 79eea3a2b..9ae32ea88 100644 --- a/gui/src/workspace/mainwindow.cpp +++ b/gui/src/workspace/mainwindow.cpp @@ -1,21 +1,24 @@ -// main-window.cpp -// Tue Apr 8 23:54:36 2008 -// Copyright 2008 joel -// - -// 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 3 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 Library 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., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA +/* + MainWindow.cpp - Definition of the main workspace window object + + Copyright (C) Lumiera.org + 2008, Joel Holdsworth + + 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 @@ -26,32 +29,33 @@ #include "gtk-lumiera.hpp" #include "mainwindow.hpp" -namespace Lumiera { -namespace Workspace { +namespace lumiera { +namespace workspace { -MainWindow::MainWindow() - : _actions(*this) -{ + MainWindow::MainWindow() + : actions(*this) + { create_ui(); -} + } -MainWindow::~MainWindow() -{ -} + MainWindow::~MainWindow() + { + } -void MainWindow::create_ui() -{ + void + MainWindow::create_ui() + { //----- Configure the Window -----// set_title(AppTitle); set_default_size(1024, 768); // The UI will be nested within a VBOX - add(_box); + add(box); - m_refUIManager = Gtk::UIManager::create(); - m_refUIManager->insert_action_group(_actions._action_group); + uiManager = Gtk::UIManager::create(); + uiManager->insert_action_group(actions.actionGroup); - add_accel_group(m_refUIManager->get_accel_group()); + add_accel_group(uiManager->get_accel_group()); //Layout the actions in a menubar and toolbar: Glib::ustring ui_info = @@ -87,35 +91,33 @@ void MainWindow::create_ui() #ifdef GLIBMM_EXCEPTIONS_ENABLED try { - m_refUIManager->add_ui_from_string(ui_info); + uiManager->add_ui_from_string(ui_info); } catch(const Glib::Error& ex) { - g_error("building menus failed: "); - return; + g_error("building menus failed: "); + return; } #else std::auto_ptr ex; - m_refUIManager->add_ui_from_string(ui_info, ex); + uiManager->add_ui_from_string(ui_info, ex); if(ex.get()) { - g_error("building menus failed: "); - return; + g_error("building menus failed: "); + return; } #endif //GLIBMM_EXCEPTIONS_ENABLED // Get the menubar and toolbar widgets, and add them to a container widget: - Gtk::Widget* pMenubar = m_refUIManager->get_widget("/MenuBar"); - if(pMenubar) - _box.pack_start(*pMenubar, Gtk::PACK_SHRINK); + Gtk::Widget* menu_bar = uiManager->get_widget("/MenuBar"); + if(menu_bar) box.pack_start(*menu_bar, Gtk::PACK_SHRINK); - Gtk::Widget* pToolbar = m_refUIManager->get_widget("/ToolBar") ; - if(pToolbar) - _box.pack_start(*pToolbar, Gtk::PACK_SHRINK); + Gtk::Widget* toolbar = uiManager->get_widget("/ToolBar") ; + if(toolbar) box.pack_start(*toolbar, Gtk::PACK_SHRINK); show_all_children(); -} + } -} // namespace Workspace -} // namespace Lumiera +} // namespace workspace +} // namespace lumiera diff --git a/gui/src/workspace/mainwindow.hpp b/gui/src/workspace/mainwindow.hpp index 7beab8783..494393051 100644 --- a/gui/src/workspace/mainwindow.hpp +++ b/gui/src/workspace/mainwindow.hpp @@ -1,17 +1,29 @@ /* - * 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 3 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 Library 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., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA + MainWindow.hpp - Definition of the main workspace window object + + Copyright (C) Lumiera.org + 2008, Joel Holdsworth + + 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. + +*/ +/** @file mainwindow.hpp + ** This file contains the definition of the main workspace window + ** parent, which is the toplevel parent of the whole workspace. + ** + ** @see mainwindow.hpp */ #ifndef MAIN_WINDOW_H @@ -20,28 +32,35 @@ #include #include "actions.hpp" -namespace Lumiera { -namespace Workspace { +namespace lumiera { +namespace workspace { + + /** + * The main lumiera workspace window + */ + class MainWindow : public Gtk::Window + { + public: + MainWindow(); + virtual ~MainWindow(); -class MainWindow : public Gtk::Window -{ -public: - MainWindow(); - virtual ~MainWindow(); - -protected: - void create_ui(); - - // Helpers - Actions _actions; + protected: + void create_ui(); - // Child widgets - Gtk::VBox _box; + /* ===== UI ===== */ + protected: + Gtk::VBox box; + Glib::RefPtr uiManager; + + /* ===== Helpers ===== */ + protected: + /** + * The instantiation of the actions helper class, which + * registers and handles user action events */ + Actions actions; + }; - Glib::RefPtr m_refUIManager; -}; - -} // namespace Workspace -} // namespace Lumiera +} // namespace workspace +} // namespace lumiera #endif // MAIN_WINDOW_H From 6498aef338697f84e67603f30318a1fae16b9229 Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Sat, 12 Apr 2008 00:23:12 +0100 Subject: [PATCH 007/110] Removed some build files which should not be present --- gui/config.h | 77 ------------------------------------------ gui/gtk-lumiera.anjuta | 44 ------------------------ 2 files changed, 121 deletions(-) delete mode 100644 gui/config.h delete mode 100644 gui/gtk-lumiera.anjuta diff --git a/gui/config.h b/gui/config.h deleted file mode 100644 index 7b9564f69..000000000 --- a/gui/config.h +++ /dev/null @@ -1,77 +0,0 @@ -/* config.h. Generated from config.h.in by configure. */ -/* config.h.in. Generated from configure.ac by autoheader. */ - -/* always defined to indicate that i18n is enabled */ -#define ENABLE_NLS 1 - -/* GETTEXT package name */ -#define GETTEXT_PACKAGE "gtk-lumiera" - -/* Define to 1 if you have the `bind_textdomain_codeset' function. */ -#define HAVE_BIND_TEXTDOMAIN_CODESET 1 - -/* Define to 1 if you have the `dcgettext' function. */ -#define HAVE_DCGETTEXT 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_DLFCN_H 1 - -/* Define if the GNU gettext() function is already present or preinstalled. */ -#define HAVE_GETTEXT 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_INTTYPES_H 1 - -/* Define if your file defines LC_MESSAGES. */ -#define HAVE_LC_MESSAGES 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_LOCALE_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_MEMORY_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDINT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDLIB_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STRINGS_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STRING_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_STAT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_TYPES_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_UNISTD_H 1 - -/* Name of package */ -#define PACKAGE "gtk-lumiera" - -/* Define to the address where bug reports for this package should be sent. */ -#define PACKAGE_BUGREPORT "" - -/* Define to the full name of this package. */ -#define PACKAGE_NAME "gtk-lumiera" - -/* Define to the full name and version of this package. */ -#define PACKAGE_STRING "gtk-lumiera 0.1" - -/* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "gtk-lumiera" - -/* Define to the version of this package. */ -#define PACKAGE_VERSION "0.1" - -/* Define to 1 if you have the ANSI C header files. */ -#define STDC_HEADERS 1 - -/* Version number of package */ -#define VERSION "0.1" diff --git a/gui/gtk-lumiera.anjuta b/gui/gtk-lumiera.anjuta deleted file mode 100644 index 8b9268a44..000000000 --- a/gui/gtk-lumiera.anjuta +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - From 4698998d43a4d81e4091ebe45b154b17ee9c5956 Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Sat, 12 Apr 2008 17:46:32 +0100 Subject: [PATCH 008/110] Added a placeholder for the Render dialog, and restructured application and namespaces --- gui/src/Makefile.am | 8 +- gui/src/{main.cpp => dialogs/render.cpp} | 43 +++--- gui/src/dialogs/render.hpp | 51 +++++++ gui/src/gtk-lumiera.cpp | 97 ++++++++++++ gui/src/gtk-lumiera.glade | 179 +++++++++++++++++++---- gui/src/gtk-lumiera.hpp | 39 ++++- gui/src/workspace/actions.cpp | 24 ++- gui/src/workspace/actions.hpp | 13 +- gui/src/workspace/mainwindow.cpp | 4 + gui/src/workspace/mainwindow.hpp | 6 +- 10 files changed, 392 insertions(+), 72 deletions(-) rename gui/src/{main.cpp => dialogs/render.cpp} (63%) create mode 100644 gui/src/dialogs/render.hpp create mode 100644 gui/src/gtk-lumiera.cpp diff --git a/gui/src/Makefile.am b/gui/src/Makefile.am index a2ef821b3..0cef35d54 100644 --- a/gui/src/Makefile.am +++ b/gui/src/Makefile.am @@ -16,12 +16,14 @@ AM_CFLAGS =\ bin_PROGRAMS = gtk-lumiera gtk_lumiera_SOURCES = \ - main.cpp \ + gtk-lumiera.cpp \ gtk-lumiera.hpp \ workspace/actions.cpp \ workspace/actions.hpp \ - workspace/mainwindow.cpp \ - workspace/mainwindow.hpp + workspace/mainwindow.cpp \ + workspace/mainwindow.hpp \ + dialogs/render.cpp \ + dialogs/render.hpp gtk_lumiera_LDFLAGS = diff --git a/gui/src/main.cpp b/gui/src/dialogs/render.cpp similarity index 63% rename from gui/src/main.cpp rename to gui/src/dialogs/render.cpp index 9b191fc1e..35f83113f 100644 --- a/gui/src/main.cpp +++ b/gui/src/dialogs/render.cpp @@ -1,5 +1,5 @@ /* - Main.cpp - The entry point for the GTK GUI application + render.cpp - Definition of the main workspace window object Copyright (C) Lumiera.org 2008, Joel Holdsworth @@ -20,34 +20,25 @@ * *****************************************************/ -#include -#include +#include "../gtk-lumiera.hpp" -#ifdef ENABLE_NLS -# include -#endif - -#include "gtk-lumiera.hpp" -#include "workspace/mainwindow.hpp" +namespace lumiera { +namespace gui { +namespace dialogs { -//const gchar* AppTitle -//const gchar AppTitle[] = N_("Lumiera"); - -using namespace lumiera::workspace; -using namespace Gtk; - - int - main (int argc, char *argv[]) + Render::Render(BaseObjectType* cobject, const Glib::RefPtr& xml) : + Gtk::Dialog(cobject) { - Main kit(argc, argv); - - Glib::set_application_name(AppTitle); - - MainWindow main_window; - - kit.run(main_window); - - return 0; + } + void + Render::init(const Glib::RefPtr& glade_xml, Render*& dialog) + { + glade_xml->get_widget_derived("Render", dialog); + } + +} // namespace dialogs +} // namespace gui +} // namespace lumiera diff --git a/gui/src/dialogs/render.hpp b/gui/src/dialogs/render.hpp new file mode 100644 index 000000000..473699bfa --- /dev/null +++ b/gui/src/dialogs/render.hpp @@ -0,0 +1,51 @@ +/* + render.hpp - Definition of the render output dialog + + Copyright (C) Lumiera.org + 2008, Joel Holdsworth + + 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. + +*/ +/** @file render.hpp + ** This file contains the definition of the render output dialog + ** + */ + +#ifndef RENDER_H +#define RENDER_H + +#include + +namespace lumiera { +namespace gui { +namespace dialogs { + + /** + * The defintion of render output dialog class + */ + class Render : public Gtk::Dialog + { + public: + Render(BaseObjectType* cobject, const Glib::RefPtr& xml); + + static void init(const Glib::RefPtr& glade_xml, Render*& dialog); + }; + +} // namespace dialogs +} // namespace gui +} // namespace lumiera + +#endif // RENDER_H diff --git a/gui/src/gtk-lumiera.cpp b/gui/src/gtk-lumiera.cpp new file mode 100644 index 000000000..146a6de00 --- /dev/null +++ b/gui/src/gtk-lumiera.cpp @@ -0,0 +1,97 @@ +/* + gtk-lumiera.cpp - The entry point for the GTK GUI application + + Copyright (C) Lumiera.org + 2008, Joel Holdsworth + + 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 +#include + +#ifdef ENABLE_NLS +# include +#endif + +#include "gtk-lumiera.hpp" +#include "workspace/mainwindow.hpp" + +using namespace lumiera::gui; +using namespace lumiera::gui::workspace; +using namespace Gtk; + +GtkLumiera the_application; + + int + main (int argc, char *argv[]) + { + + return the_application.main(argc, argv); + } + + + +namespace lumiera { +namespace gui { + + int + GtkLumiera::main(int argc, char *argv[]) + { + Main kit(argc, argv); + + Glib::set_application_name(AppTitle); + + init_ui(); + + MainWindow main_window; + + kit.run(main_window); + } + + dialogs::Render* + GtkLumiera::get_render_dialog() const + { + g_assert(renderDialog != NULL); + return renderDialog; + } + + void + GtkLumiera::init_ui() + { + try + { + gladeXml = Gnome::Glade::Xml::create("gtk-lumiera.glade"); + } + catch(const Gnome::Glade::XmlError& ex) + { + g_message(ex.what().data()); + return; + } + + dialogs::Render::init(gladeXml, renderDialog); + } + + GtkLumiera& + application() + { + return the_application; + } + +} // namespace gui +} // namespace lumiera + + diff --git a/gui/src/gtk-lumiera.glade b/gui/src/gtk-lumiera.glade index 8db3bef2c..79e9e3d89 100644 --- a/gui/src/gtk-lumiera.glade +++ b/gui/src/gtk-lumiera.glade @@ -1,27 +1,156 @@ - - - + + + - - - True - Hello World! - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - 500 - 400 - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_NORMAL - GDK_GRAVITY_NORTH_WEST - - - - - - + + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 5 + GTK_WIN_POS_CENTER_ON_PARENT + GDK_WINDOW_TYPE_HINT_DIALOG + False + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 2 + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 4 + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 4 + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + Output File: + + + False + + + + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + + + 1 + + + + + True + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + gtk-open + True + 0 + + + False + 2 + + + + + False + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 4 + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + Container Format: + + + False + False + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + + + 1 + + + + + False + 1 + + + + + + + + + + + + + + + + + + + + 1 + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + GTK_BUTTONBOX_END + + + True + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + gtk-cancel + True + 0 + + + + + True + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + gtk-ok + True + 0 + + + 1 + + + + + False + GTK_PACK_END + + + + + diff --git a/gui/src/gtk-lumiera.hpp b/gui/src/gtk-lumiera.hpp index 97eb98744..ebfb2056c 100644 --- a/gui/src/gtk-lumiera.hpp +++ b/gui/src/gtk-lumiera.hpp @@ -27,6 +27,9 @@ #ifndef GTK_LUMIERA_HPP #define GTK_LUMIERA_HPO + +#include +#include "dialogs/render.hpp" #ifdef ENABLE_NLS # include @@ -40,10 +43,38 @@ # define bindtextdomain(Package, Directory) #endif -/** - * The name of the Lumiera application - */ -static const gchar* AppTitle = N_("Lumiera"); +namespace lumiera { +namespace gui { + + /** + * The name of the Lumiera application + */ + static const gchar* AppTitle = N_("Lumiera"); + + class GtkLumiera + { + public: + int main(int argc, char *argv[]); + + public: + dialogs::Render* get_render_dialog() const; + + private: + void init_ui(); + + private: + Glib::RefPtr gladeXml; + + dialogs::Render *renderDialog; + }; + + /** + * Returns a reference to the global application object + */ + GtkLumiera& application(); + +} // namespace gui +} // namespace lumiera #endif diff --git a/gui/src/workspace/actions.cpp b/gui/src/workspace/actions.cpp index 801140ecc..7a735be96 100644 --- a/gui/src/workspace/actions.cpp +++ b/gui/src/workspace/actions.cpp @@ -20,13 +20,13 @@ * *****************************************************/ +#include "../gtk-lumiera.hpp" #include "actions.hpp" #include "mainwindow.hpp" -namespace lumiera - { -namespace workspace - { +namespace lumiera { +namespace gui { +namespace workspace { Actions::Actions(MainWindow &main_window) : mainWindow(main_window) @@ -50,8 +50,11 @@ namespace workspace actionGroup->add(Gtk::Action::create("FileMenu", "File")); // Sub-menu. actionGroup->add(Gtk::Action::create("FileNew", Gtk::Stock::NEW)); + actionGroup->add(Gtk::Action::create("FileRender", _("Render...")), + Gtk::AccelKey("R"), + sigc::mem_fun(*this, &Actions::on_menu_file_render)); actionGroup->add(Gtk::Action::create("FileQuit", Gtk::Stock::QUIT), - sigc::mem_fun(*this, &Actions::on_menu_file_quit)); + sigc::mem_fun(*this, &Actions::on_menu_file_quit)); // Edit menu: actionGroup->add(Gtk::Action::create("EditMenu", "Edit")); @@ -60,8 +63,8 @@ namespace workspace actionGroup->add(Gtk::Action::create("EditPaste", Gtk::Stock::PASTE), sigc::mem_fun(*this, &Actions::on_menu_others)); actionGroup->add(Gtk::Action::create("EditSomething", "Something"), - Gtk::AccelKey("S"), - sigc::mem_fun(*this, &Actions::on_menu_others)); + Gtk::AccelKey("S"), + sigc::mem_fun(*this, &Actions::on_menu_others)); // Choices menu, to demonstrate Radio items actionGroup->add( Gtk::Action::create("ChoicesMenu", "Choices") ); @@ -79,6 +82,12 @@ namespace workspace sigc::mem_fun(*this, &Actions::on_menu_others) ); } + void + Actions::on_menu_file_render() + { + application().get_render_dialog()->run(); + } + void Actions::on_menu_file_quit() { @@ -122,5 +131,6 @@ namespace workspace } } // namespace workspace +} // namespace gui } // namespace lumiera diff --git a/gui/src/workspace/actions.hpp b/gui/src/workspace/actions.hpp index ec8abe3bc..a552be90e 100644 --- a/gui/src/workspace/actions.hpp +++ b/gui/src/workspace/actions.hpp @@ -32,6 +32,7 @@ #include namespace lumiera { +namespace gui { namespace workspace { class MainWindow; @@ -51,12 +52,13 @@ class MainWindow; MainWindow &mainWindow; /* ===== Event Handlers ===== */ - void on_menu_file_new_generic(); - void on_menu_file_quit(); - void on_menu_others(); + void on_menu_file_new_generic(); + void on_menu_file_render(); + void on_menu_file_quit(); + void on_menu_others(); - void on_menu_choices_one(); - void on_menu_choices_two(); + void on_menu_choices_one(); + void on_menu_choices_two(); /* ===== Actions ===== */ Glib::RefPtr actionGroup; @@ -66,6 +68,7 @@ class MainWindow; }; } // namespace workspace +} // namespace gui } // namespace lumiera #endif // ACTIONS_H diff --git a/gui/src/workspace/mainwindow.cpp b/gui/src/workspace/mainwindow.cpp index 9ae32ea88..8b2c13074 100644 --- a/gui/src/workspace/mainwindow.cpp +++ b/gui/src/workspace/mainwindow.cpp @@ -30,6 +30,7 @@ #include "mainwindow.hpp" namespace lumiera { +namespace gui { namespace workspace { MainWindow::MainWindow() @@ -68,6 +69,8 @@ namespace workspace { " " " " " " + " " + " " " " " " " " @@ -119,5 +122,6 @@ namespace workspace { } } // namespace workspace +} // namespace gui } // namespace lumiera diff --git a/gui/src/workspace/mainwindow.hpp b/gui/src/workspace/mainwindow.hpp index 494393051..541646c29 100644 --- a/gui/src/workspace/mainwindow.hpp +++ b/gui/src/workspace/mainwindow.hpp @@ -1,5 +1,5 @@ /* - MainWindow.hpp - Definition of the main workspace window object + mainwindow.hpp - Definition of the main workspace window object Copyright (C) Lumiera.org 2008, Joel Holdsworth @@ -23,7 +23,7 @@ ** This file contains the definition of the main workspace window ** parent, which is the toplevel parent of the whole workspace. ** - ** @see mainwindow.hpp + ** @see actions.hpp */ #ifndef MAIN_WINDOW_H @@ -33,6 +33,7 @@ #include "actions.hpp" namespace lumiera { +namespace gui { namespace workspace { /** @@ -61,6 +62,7 @@ namespace workspace { }; } // namespace workspace +} // namespace gui } // namespace lumiera #endif // MAIN_WINDOW_H From 584a33408bda46b0a1a6f2a668cced8bf1ddfc8b Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Sat, 12 Apr 2008 21:15:07 +0100 Subject: [PATCH 009/110] Added GDL docking framework, and some placeholder panels --- gui/src/Makefile.am | 12 +++++-- gui/src/panels/assets.cpp | 38 ++++++++++++++++++++ gui/src/panels/assets.hpp | 48 +++++++++++++++++++++++++ gui/src/panels/panel.cpp | 49 +++++++++++++++++++++++++ gui/src/panels/panel.hpp | 59 ++++++++++++++++++++++++++++++ gui/src/panels/timeline.cpp | 38 ++++++++++++++++++++ gui/src/panels/timeline.hpp | 48 +++++++++++++++++++++++++ gui/src/panels/viewer.cpp | 38 ++++++++++++++++++++ gui/src/panels/viewer.hpp | 48 +++++++++++++++++++++++++ gui/src/workspace/mainwindow.cpp | 61 +++++++++++++++++++++++--------- gui/src/workspace/mainwindow.hpp | 29 ++++++++++++--- 11 files changed, 445 insertions(+), 23 deletions(-) create mode 100644 gui/src/panels/assets.cpp create mode 100644 gui/src/panels/assets.hpp create mode 100644 gui/src/panels/panel.cpp create mode 100644 gui/src/panels/panel.hpp create mode 100644 gui/src/panels/timeline.cpp create mode 100644 gui/src/panels/timeline.hpp create mode 100644 gui/src/panels/viewer.cpp create mode 100644 gui/src/panels/viewer.hpp diff --git a/gui/src/Makefile.am b/gui/src/Makefile.am index 0cef35d54..0d149d8de 100644 --- a/gui/src/Makefile.am +++ b/gui/src/Makefile.am @@ -16,14 +16,22 @@ AM_CFLAGS =\ bin_PROGRAMS = gtk-lumiera gtk_lumiera_SOURCES = \ - gtk-lumiera.cpp \ + gtk-lumiera.cpp \ gtk-lumiera.hpp \ workspace/actions.cpp \ workspace/actions.hpp \ workspace/mainwindow.cpp \ workspace/mainwindow.hpp \ dialogs/render.cpp \ - dialogs/render.hpp + dialogs/render.hpp \ + panels/panel.cpp \ + panels/panel.hpp \ + panels/timeline.cpp \ + panels/timeline.hpp \ + panels/viewer.cpp \ + panels/viewer.hpp \ + panels/assets.cpp \ + panels/assets.hpp gtk_lumiera_LDFLAGS = diff --git a/gui/src/panels/assets.cpp b/gui/src/panels/assets.cpp new file mode 100644 index 000000000..daaa0f363 --- /dev/null +++ b/gui/src/panels/assets.cpp @@ -0,0 +1,38 @@ +/* + assets.cpp - Implementation of the assets panel + + Copyright (C) Lumiera.org + 2008, Joel Holdsworth + + 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 "assets.hpp" + +namespace lumiera { +namespace gui { +namespace panels { + +Assets::Assets() : + Panel("assets", "Assets"), + placeholder("Placeholder label. Is this supposed to be titled assets\nas in the proc layer? or resources\nas in cinelerra?") + { + pack_start(placeholder); + } + +} // namespace panels +} // namespace gui +} // namespace lumiera diff --git a/gui/src/panels/assets.hpp b/gui/src/panels/assets.hpp new file mode 100644 index 000000000..1a11107d9 --- /dev/null +++ b/gui/src/panels/assets.hpp @@ -0,0 +1,48 @@ +/* + assets.hpp - Definition of the assets panel + + Copyright (C) Lumiera.org + 2008, Joel Holdsworth + + 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. + +*/ +/** @file timeline.hpp + ** This file contains the definition of the assets panel + */ + +#ifndef ASSETS_H +#define ASSETS_H + +#include "panel.hpp" + +namespace lumiera { +namespace gui { +namespace panels { + + class Assets : public Panel + { + public: + Assets(); + + protected: + Gtk::Label placeholder; + }; + +} // namespace panels +} // namespace gui +} // namespace lumiera + +#endif // ASSETS_H diff --git a/gui/src/panels/panel.cpp b/gui/src/panels/panel.cpp new file mode 100644 index 000000000..67ac1fd3f --- /dev/null +++ b/gui/src/panels/panel.cpp @@ -0,0 +1,49 @@ +/* + panel.cpp - Implementation of Panel, the base class for docking panels + + Copyright (C) Lumiera.org + 2008, Joel Holdsworth + + 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 "panel.hpp" + +namespace lumiera { +namespace gui { +namespace panels { + +Panel::Panel(const gchar *name, const gchar *long_name, GdlDockItemBehavior behavior) +{ + dock_item = (GdlDockItem*)gdl_dock_item_new (name, long_name, behavior); + gtk_container_add ((GtkContainer*)dock_item, (GtkWidget*)gobj()); + gtk_widget_show ((GtkWidget*)dock_item); +} + +Panel::~Panel() +{ + +} + +GdlDockItem* Panel::get_dock_item() const +{ + return dock_item; +} + +} // namespace panels +} // namespace gui +} // namespace lumiera + diff --git a/gui/src/panels/panel.hpp b/gui/src/panels/panel.hpp new file mode 100644 index 000000000..fdb7296cf --- /dev/null +++ b/gui/src/panels/panel.hpp @@ -0,0 +1,59 @@ +/* + panel.hpp - Definition of Panel, the base class for docking panels + + Copyright (C) Lumiera.org + 2008, Joel Holdsworth + + 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. + +*/ +/** @file panel.hpp + ** This file contains the definition of Panel; the base class + ** for all docking panels + */ + +#ifndef PANEL_H +#define PANEL_H + +#include +#include + +namespace lumiera { +namespace gui { +namespace panels { + + /** + * The main lumiera workspace window + */ + class Panel : public Gtk::VBox + { + protected: + Panel(const gchar *name, const gchar *long_name, + GdlDockItemBehavior behavior = GDL_DOCK_ITEM_BEH_NORMAL); + ~Panel(); + + public: + GdlDockItem* get_dock_item() const; + + + protected: + GdlDockItem* dock_item; + }; + +} // namespace panels +} // namespace gui +} // namespace lumiera + +#endif // PANEL_H diff --git a/gui/src/panels/timeline.cpp b/gui/src/panels/timeline.cpp new file mode 100644 index 000000000..1e5086fd7 --- /dev/null +++ b/gui/src/panels/timeline.cpp @@ -0,0 +1,38 @@ +/* + timeline.cpp - Implementation of the timeline panel + + Copyright (C) Lumiera.org + 2008, Joel Holdsworth + + 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 "timeline.hpp" + +namespace lumiera { +namespace gui { +namespace panels { + +Timeline::Timeline() : + Panel("timeline", "Timeline"), + placeholder("Placeholder label. Is Timeline the correct title for this panel?") + { + pack_start(placeholder); + } + +} // namespace panels +} // namespace gui +} // namespace lumiera diff --git a/gui/src/panels/timeline.hpp b/gui/src/panels/timeline.hpp new file mode 100644 index 000000000..54c6afe1e --- /dev/null +++ b/gui/src/panels/timeline.hpp @@ -0,0 +1,48 @@ +/* + timeline.hpp - Definition of the timeline panel + + Copyright (C) Lumiera.org + 2008, Joel Holdsworth + + 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. + +*/ +/** @file timeline.hpp + ** This file contains the definition of the timeline panel + */ + +#ifndef TIMELINE_H +#define TIMELINE_H + +#include "panel.hpp" + +namespace lumiera { +namespace gui { +namespace panels { + + class Timeline : public Panel + { + public: + Timeline(); + + protected: + Gtk::Label placeholder; + }; + +} // namespace panels +} // namespace gui +} // namespace lumiera + +#endif // TIMELINE_H diff --git a/gui/src/panels/viewer.cpp b/gui/src/panels/viewer.cpp new file mode 100644 index 000000000..991bb7457 --- /dev/null +++ b/gui/src/panels/viewer.cpp @@ -0,0 +1,38 @@ +/* + viewer.cpp - Implementation of the viewer panel + + Copyright (C) Lumiera.org + 2008, Joel Holdsworth + + 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 "viewer.hpp" + +namespace lumiera { +namespace gui { +namespace panels { + +Viewer::Viewer() : + Panel("viewer", "Viewer"), + placeholder("Placeholder: XVideo in here!!!") + { + pack_start(placeholder); + } + +} // namespace panels +} // namespace gui +} // namespace lumiera diff --git a/gui/src/panels/viewer.hpp b/gui/src/panels/viewer.hpp new file mode 100644 index 000000000..8090f01c4 --- /dev/null +++ b/gui/src/panels/viewer.hpp @@ -0,0 +1,48 @@ +/* + viewer.hpp - Definition of the viewer panel + + Copyright (C) Lumiera.org + 2008, Joel Holdsworth + + 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. + +*/ +/** @file viewer.hpp + ** This file contains the definition of the viewer panel + */ + +#ifndef VIEWER_H +#define VIEWER_H + +#include "panel.hpp" + +namespace lumiera { +namespace gui { +namespace panels { + + class Viewer : public Panel + { + public: + Viewer(); + + protected: + Gtk::Button placeholder; + }; + +} // namespace panels +} // namespace gui +} // namespace lumiera + +#endif // VIEWER_H diff --git a/gui/src/workspace/mainwindow.cpp b/gui/src/workspace/mainwindow.cpp index 8b2c13074..bbff0aa6d 100644 --- a/gui/src/workspace/mainwindow.cpp +++ b/gui/src/workspace/mainwindow.cpp @@ -26,9 +26,20 @@ # include #endif +#include + +#include +#include +#include +#include +#include +#include + #include "gtk-lumiera.hpp" #include "mainwindow.hpp" +using namespace Gtk; + namespace lumiera { namespace gui { namespace workspace { @@ -51,7 +62,7 @@ namespace workspace { set_default_size(1024, 768); // The UI will be nested within a VBOX - add(box); + add(base_container); uiManager = Gtk::UIManager::create(); uiManager->insert_action_group(actions.actionGroup); @@ -91,34 +102,52 @@ namespace workspace { " " ""; -#ifdef GLIBMM_EXCEPTIONS_ENABLED try { uiManager->add_ui_from_string(ui_info); } catch(const Glib::Error& ex) { - g_error("building menus failed: "); + g_error("building menus failed: %s", ex.what().data()); return; } -#else - std::auto_ptr ex; - uiManager->add_ui_from_string(ui_info, ex); - if(ex.get()) - { - g_error("building menus failed: "); - return; - } -#endif //GLIBMM_EXCEPTIONS_ENABLED // Get the menubar and toolbar widgets, and add them to a container widget: Gtk::Widget* menu_bar = uiManager->get_widget("/MenuBar"); - if(menu_bar) box.pack_start(*menu_bar, Gtk::PACK_SHRINK); - + g_assert(menu_bar); + base_container.pack_start(*menu_bar, Gtk::PACK_SHRINK); + Gtk::Widget* toolbar = uiManager->get_widget("/ToolBar") ; - if(toolbar) box.pack_start(*toolbar, Gtk::PACK_SHRINK); + g_assert(toolbar); + base_container.pack_start(*toolbar, Gtk::PACK_SHRINK); - show_all_children(); + //----- Create the dock -----// + dock = Glib::wrap(gdl_dock_new()); + + layout = gdl_dock_layout_new((GdlDock*)dock->gobj()); + + dockbar = Glib::wrap(gdl_dock_bar_new ((GdlDock*)dock->gobj())); + gdl_dock_bar_set_style((GdlDockBar*)dockbar->gobj(), GDL_DOCK_BAR_TEXT); + + dock_container.pack_start(*dockbar, PACK_SHRINK); + dock_container.pack_end(*dock, PACK_EXPAND_WIDGET); + base_container.pack_start(dock_container, PACK_EXPAND_WIDGET); + + gdl_dock_add_item ((GdlDock*)dock->gobj(), assets.get_dock_item(), GDL_DOCK_LEFT); + gdl_dock_add_item ((GdlDock*)dock->gobj(), viewer.get_dock_item(), GDL_DOCK_RIGHT); + gdl_dock_add_item ((GdlDock*)dock->gobj(), timeline.get_dock_item(), GDL_DOCK_BOTTOM); + + // Manually dock and move around some of the items + gdl_dock_item_dock_to (timeline.get_dock_item(), assets.get_dock_item(), + GDL_DOCK_BOTTOM, -1); + gdl_dock_item_dock_to (viewer.get_dock_item(), assets.get_dock_item(), + GDL_DOCK_RIGHT, -1); + show_all_children(); + + gdl_dock_placeholder_new ("ph1", (GdlDockObject*)dock->gobj(), GDL_DOCK_TOP, FALSE); + gdl_dock_placeholder_new ("ph2", (GdlDockObject*)dock->gobj(), GDL_DOCK_BOTTOM, FALSE); + gdl_dock_placeholder_new ("ph3", (GdlDockObject*)dock->gobj(), GDL_DOCK_LEFT, FALSE); + gdl_dock_placeholder_new ("ph4", (GdlDockObject*)dock->gobj(), GDL_DOCK_RIGHT, FALSE); } } // namespace workspace diff --git a/gui/src/workspace/mainwindow.hpp b/gui/src/workspace/mainwindow.hpp index 541646c29..3913533cc 100644 --- a/gui/src/workspace/mainwindow.hpp +++ b/gui/src/workspace/mainwindow.hpp @@ -26,12 +26,20 @@ ** @see actions.hpp */ -#ifndef MAIN_WINDOW_H -#define MAIN_WINDOW_H +#ifndef MAINWINDOW_H +#define MAINWINDOW_H #include +#include + #include "actions.hpp" +#include "../panels/assets.hpp" +#include "../panels/viewer.hpp" +#include "../panels/timeline.hpp" + +using namespace lumiera::gui::panels; + namespace lumiera { namespace gui { namespace workspace { @@ -42,17 +50,28 @@ namespace workspace { class MainWindow : public Gtk::Window { public: - MainWindow(); - virtual ~MainWindow(); + MainWindow(); + virtual ~MainWindow(); protected: void create_ui(); /* ===== UI ===== */ protected: - Gtk::VBox box; Glib::RefPtr uiManager; + Gtk::VBox base_container; + Gtk::HBox dock_container; + Gtk::Widget *dock; + Gtk::Widget *dockbar; + GdlDockLayout *layout; + + /* ===== Panels ===== */ + protected: + Assets assets; + Viewer viewer; + Timeline timeline; + /* ===== Helpers ===== */ protected: /** From 1c91e56fc5e79b9ff3b3d94efa96504334b77087 Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Mon, 14 Apr 2008 21:10:56 +0100 Subject: [PATCH 010/110] Corrected the version check for gdl >= v0.7.6 --- gui/configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gui/configure.ac b/gui/configure.ac index 0bc4740c9..170dcc687 100644 --- a/gui/configure.ac +++ b/gui/configure.ac @@ -30,7 +30,7 @@ AM_PROG_LIBTOOL -PKG_CHECK_MODULES(GTK_LUMIERA, [gtkmm-2.4 >= 2.8 libglademm-2.4 >= 2.6 gdl-1.0 >= 0.2.6]) +PKG_CHECK_MODULES(GTK_LUMIERA, [gtkmm-2.4 >= 2.8 libglademm-2.4 >= 2.6 gdl-1.0 >= 0.7.6]) AC_SUBST(GTK_LUMIERA_CFLAGS) AC_SUBST(GTK_LUMIERA_LIBS) From 368f3595b407b5f85db393eb20f36f7734010630 Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Mon, 14 Apr 2008 22:51:59 +0100 Subject: [PATCH 011/110] Renamed mainwindow.* -> main-window.*, and added the base of video viewer widget --- gui/src/Makefile.am | 8 +- gui/src/gtk-lumiera.cpp | 2 +- gui/src/panels/timeline.hpp | 4 +- gui/src/panels/viewer.cpp | 7 +- gui/src/panels/viewer.hpp | 5 +- gui/src/widgets/video-display.cpp | 77 +++++++++++++++++++ gui/src/widgets/video-display.hpp | 50 ++++++++++++ gui/src/workspace/actions.cpp | 2 +- .../{mainwindow.cpp => main-window.cpp} | 4 +- .../{mainwindow.hpp => main-window.hpp} | 8 +- 10 files changed, 150 insertions(+), 17 deletions(-) create mode 100644 gui/src/widgets/video-display.cpp create mode 100644 gui/src/widgets/video-display.hpp rename gui/src/workspace/{mainwindow.cpp => main-window.cpp} (97%) rename gui/src/workspace/{mainwindow.hpp => main-window.hpp} (93%) diff --git a/gui/src/Makefile.am b/gui/src/Makefile.am index 0d149d8de..eda59746e 100644 --- a/gui/src/Makefile.am +++ b/gui/src/Makefile.am @@ -20,8 +20,8 @@ gtk_lumiera_SOURCES = \ gtk-lumiera.hpp \ workspace/actions.cpp \ workspace/actions.hpp \ - workspace/mainwindow.cpp \ - workspace/mainwindow.hpp \ + workspace/main-window.cpp \ + workspace/main-window.hpp \ dialogs/render.cpp \ dialogs/render.hpp \ panels/panel.cpp \ @@ -31,7 +31,9 @@ gtk_lumiera_SOURCES = \ panels/viewer.cpp \ panels/viewer.hpp \ panels/assets.cpp \ - panels/assets.hpp + panels/assets.hpp \ + widgets/video-display.cpp \ + widgets/video-display.hpp gtk_lumiera_LDFLAGS = diff --git a/gui/src/gtk-lumiera.cpp b/gui/src/gtk-lumiera.cpp index 146a6de00..1a6dfacc5 100644 --- a/gui/src/gtk-lumiera.cpp +++ b/gui/src/gtk-lumiera.cpp @@ -28,7 +28,7 @@ #endif #include "gtk-lumiera.hpp" -#include "workspace/mainwindow.hpp" +#include "workspace/main-window.hpp" using namespace lumiera::gui; using namespace lumiera::gui::workspace; diff --git a/gui/src/panels/timeline.hpp b/gui/src/panels/timeline.hpp index 54c6afe1e..b219b3f55 100644 --- a/gui/src/panels/timeline.hpp +++ b/gui/src/panels/timeline.hpp @@ -23,8 +23,8 @@ ** This file contains the definition of the timeline panel */ -#ifndef TIMELINE_H -#define TIMELINE_H +#ifndef TIMELINE_HPP +#define TIMELINE_HPP #include "panel.hpp" diff --git a/gui/src/panels/viewer.cpp b/gui/src/panels/viewer.cpp index 991bb7457..d10ca7929 100644 --- a/gui/src/panels/viewer.cpp +++ b/gui/src/panels/viewer.cpp @@ -22,15 +22,16 @@ #include "viewer.hpp" +using namespace lumiera::gui::widgets; + namespace lumiera { namespace gui { namespace panels { Viewer::Viewer() : - Panel("viewer", "Viewer"), - placeholder("Placeholder: XVideo in here!!!") + Panel("viewer", "Viewer") { - pack_start(placeholder); + pack_start(display); } } // namespace panels diff --git a/gui/src/panels/viewer.hpp b/gui/src/panels/viewer.hpp index 8090f01c4..5d7038961 100644 --- a/gui/src/panels/viewer.hpp +++ b/gui/src/panels/viewer.hpp @@ -27,6 +27,9 @@ #define VIEWER_H #include "panel.hpp" +#include "../widgets/video-display.hpp" + +using namespace lumiera::gui::widgets; namespace lumiera { namespace gui { @@ -38,7 +41,7 @@ namespace panels { Viewer(); protected: - Gtk::Button placeholder; + VideoDisplay display; }; } // namespace panels diff --git a/gui/src/widgets/video-display.cpp b/gui/src/widgets/video-display.cpp new file mode 100644 index 000000000..4ec1eada5 --- /dev/null +++ b/gui/src/widgets/video-display.cpp @@ -0,0 +1,77 @@ +/* + video-display.cpp - Implementation of the video viewer widget + + Copyright (C) Lumiera.org + 2008, Joel Holdsworth + + 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 +#include + +#include "video-display.hpp" + +namespace lumiera { +namespace gui { +namespace widgets { + +VideoDisplay::VideoDisplay() + { + set_flags(Gtk::NO_WINDOW); + } + +void +VideoDisplay::on_realize() + { + //Call base class: + Gtk::Widget::on_realize(); + + } + +bool +VideoDisplay::on_expose_event(GdkEventExpose* event) + { + // This is where we draw on the window + Glib::RefPtr window = get_window(); + if(window) + { + double scale_x = 1; + double scale_y = 1; + + Cairo::RefPtr cr = window->create_cairo_context(); + if(event) + { + // clip to the area that needs to be re-exposed so we don't draw any + // more than we need to. + cr->rectangle(event->area.x, event->area.y, + event->area.width, event->area.height); + cr->clip(); + } + + // Paint the background + cr->set_source_rgb(0.0, 0.0, 0.0); + cr->paint(); + } + return true; + } + + + +} // namespace widgets +} // namespace gui +} // namespace lumiera + diff --git a/gui/src/widgets/video-display.hpp b/gui/src/widgets/video-display.hpp new file mode 100644 index 000000000..34fbce81c --- /dev/null +++ b/gui/src/widgets/video-display.hpp @@ -0,0 +1,50 @@ +/* + video-display.hpp - Declaration of the video viewer widget + + Copyright (C) Lumiera.org + 2008, Joel Holdsworth + + 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. + +*/ +/** @file viewer.hpp + ** This file contains the definition of video viewer widget + */ + +#ifndef VIDEO_DISPLAY_HPP +#define VIDEO_DISPLAY_HPP + +#include + +namespace lumiera { +namespace gui { +namespace widgets { + + class VideoDisplay : public Gtk::Widget + { + public: + VideoDisplay(); + + /* ===== Overrides ===== */ + protected: + virtual void on_realize(); + virtual bool on_expose_event(GdkEventExpose* event); + }; + +} // namespace widgets +} // namespace gui +} // namespace lumiera + +#endif // VIDEO_DISPLAY_H diff --git a/gui/src/workspace/actions.cpp b/gui/src/workspace/actions.cpp index 7a735be96..a6633b4aa 100644 --- a/gui/src/workspace/actions.cpp +++ b/gui/src/workspace/actions.cpp @@ -22,7 +22,7 @@ #include "../gtk-lumiera.hpp" #include "actions.hpp" -#include "mainwindow.hpp" +#include "main-window.hpp" namespace lumiera { namespace gui { diff --git a/gui/src/workspace/mainwindow.cpp b/gui/src/workspace/main-window.cpp similarity index 97% rename from gui/src/workspace/mainwindow.cpp rename to gui/src/workspace/main-window.cpp index bbff0aa6d..d51dd554b 100644 --- a/gui/src/workspace/mainwindow.cpp +++ b/gui/src/workspace/main-window.cpp @@ -1,5 +1,5 @@ /* - MainWindow.cpp - Definition of the main workspace window object + main-window.cpp - Definition of the main workspace window object Copyright (C) Lumiera.org 2008, Joel Holdsworth @@ -36,7 +36,7 @@ #include #include "gtk-lumiera.hpp" -#include "mainwindow.hpp" +#include "main-window.hpp" using namespace Gtk; diff --git a/gui/src/workspace/mainwindow.hpp b/gui/src/workspace/main-window.hpp similarity index 93% rename from gui/src/workspace/mainwindow.hpp rename to gui/src/workspace/main-window.hpp index 3913533cc..1b997623a 100644 --- a/gui/src/workspace/mainwindow.hpp +++ b/gui/src/workspace/main-window.hpp @@ -1,5 +1,5 @@ /* - mainwindow.hpp - Definition of the main workspace window object + main-window.hpp - Definition of the main workspace window object Copyright (C) Lumiera.org 2008, Joel Holdsworth @@ -26,8 +26,8 @@ ** @see actions.hpp */ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H +#ifndef MAIN_WINDOW_HPP +#define MAIN_WINDOW_HPP #include #include @@ -84,4 +84,4 @@ namespace workspace { } // namespace gui } // namespace lumiera -#endif // MAIN_WINDOW_H +#endif // MAIN_WINDOW_HPP From 26fb2497e66c34bfac9ff95f593da6ada2688649 Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Mon, 14 Apr 2008 22:57:13 +0100 Subject: [PATCH 012/110] Modified toolbar style from default to icons only --- gui/src/workspace/main-window.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/gui/src/workspace/main-window.cpp b/gui/src/workspace/main-window.cpp index d51dd554b..096f28014 100644 --- a/gui/src/workspace/main-window.cpp +++ b/gui/src/workspace/main-window.cpp @@ -61,6 +61,7 @@ namespace workspace { set_title(AppTitle); set_default_size(1024, 768); + //----- Set up the UI Manager -----// // The UI will be nested within a VBOX add(base_container); @@ -112,13 +113,15 @@ namespace workspace { return; } - // Get the menubar and toolbar widgets, and add them to a container widget: + //----- Set up the Menu Bar -----// Gtk::Widget* menu_bar = uiManager->get_widget("/MenuBar"); - g_assert(menu_bar); + g_assert(menu_bar != NULL); base_container.pack_start(*menu_bar, Gtk::PACK_SHRINK); - Gtk::Widget* toolbar = uiManager->get_widget("/ToolBar") ; - g_assert(toolbar); + //----- Set up the Tool Bar -----// + Gtk::Toolbar* toolbar = dynamic_cast(uiManager->get_widget("/ToolBar")); + g_assert(toolbar != NULL); + toolbar->set_toolbar_style(TOOLBAR_ICONS); base_container.pack_start(*toolbar, Gtk::PACK_SHRINK); //----- Create the dock -----// From 8691db867165093a4d34bbe0e9b15cb24df6b9dd Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Mon, 14 Apr 2008 23:23:29 +0100 Subject: [PATCH 013/110] Added basic playback controls to the viewer panel --- gui/src/panels/viewer.cpp | 23 +++++++++++++++++++++-- gui/src/panels/viewer.hpp | 11 +++++++++++ gui/src/workspace/main-window.cpp | 3 +-- 3 files changed, 33 insertions(+), 4 deletions(-) diff --git a/gui/src/panels/viewer.cpp b/gui/src/panels/viewer.cpp index d10ca7929..0c64f3d68 100644 --- a/gui/src/panels/viewer.cpp +++ b/gui/src/panels/viewer.cpp @@ -23,15 +23,34 @@ #include "viewer.hpp" using namespace lumiera::gui::widgets; +using namespace Gtk; namespace lumiera { namespace gui { namespace panels { Viewer::Viewer() : - Panel("viewer", "Viewer") + Panel("viewer", "Viewer"), + previousButton(Stock::MEDIA_PREVIOUS), + rewindButton(Stock::MEDIA_REWIND), + playPauseButton(Stock::MEDIA_PLAY), + forwardButton(Stock::MEDIA_FORWARD), + nextButton(Stock::MEDIA_NEXT) { - pack_start(display); + //----- Set up the Tool Bar -----// + // Add the commands + toolBar.append(previousButton); + toolBar.append(rewindButton); + toolBar.append(playPauseButton); + toolBar.append(forwardButton); + toolBar.append(nextButton); + + // Configure the toolbar + toolBar.set_toolbar_style(TOOLBAR_ICONS); + + //----- Pack in the Widgets -----// + pack_start(display, PACK_EXPAND_WIDGET); + pack_start(toolBar, PACK_SHRINK); } } // namespace panels diff --git a/gui/src/panels/viewer.hpp b/gui/src/panels/viewer.hpp index 5d7038961..e6d459ffa 100644 --- a/gui/src/panels/viewer.hpp +++ b/gui/src/panels/viewer.hpp @@ -26,10 +26,13 @@ #ifndef VIEWER_H #define VIEWER_H +#include + #include "panel.hpp" #include "../widgets/video-display.hpp" using namespace lumiera::gui::widgets; +using namespace Gtk; namespace lumiera { namespace gui { @@ -41,7 +44,15 @@ namespace panels { Viewer(); protected: + + ToolButton previousButton; + ToolButton rewindButton; + ToolButton playPauseButton; + ToolButton forwardButton; + ToolButton nextButton; + VideoDisplay display; + Toolbar toolBar; }; } // namespace panels diff --git a/gui/src/workspace/main-window.cpp b/gui/src/workspace/main-window.cpp index 096f28014..3f1868d03 100644 --- a/gui/src/workspace/main-window.cpp +++ b/gui/src/workspace/main-window.cpp @@ -27,7 +27,6 @@ #endif #include - #include #include #include @@ -109,7 +108,7 @@ namespace workspace { } catch(const Glib::Error& ex) { - g_error("building menus failed: %s", ex.what().data()); + g_error("Building menus failed: %s", ex.what().data()); return; } From c7255625ec77b5b9abb0e5d23295e14fb558393a Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Tue, 15 Apr 2008 23:36:15 +0100 Subject: [PATCH 014/110] Restructured dialogs a bit. Dialogs are now centred on the main window when shown --- gui/src/dialogs/render.cpp | 7 ++++--- gui/src/dialogs/render.hpp | 4 +++- gui/src/workspace/actions.cpp | 2 +- gui/src/workspace/main-window.cpp | 17 +++++++++++++++++ gui/src/workspace/main-window.hpp | 12 ++++++++++++ 5 files changed, 37 insertions(+), 5 deletions(-) diff --git a/gui/src/dialogs/render.cpp b/gui/src/dialogs/render.cpp index 35f83113f..48423ebb0 100644 --- a/gui/src/dialogs/render.cpp +++ b/gui/src/dialogs/render.cpp @@ -20,13 +20,12 @@ * *****************************************************/ -#include "../gtk-lumiera.hpp" +#include "render.hpp" namespace lumiera { namespace gui { namespace dialogs { - Render::Render(BaseObjectType* cobject, const Glib::RefPtr& xml) : Gtk::Dialog(cobject) { @@ -34,9 +33,11 @@ namespace dialogs { } void - Render::init(const Glib::RefPtr& glade_xml, Render*& dialog) + Render::init(Gtk::Window &parent, + const Glib::RefPtr& glade_xml, Render*& dialog) { glade_xml->get_widget_derived("Render", dialog); + if(dialog != NULL) dialog->set_transient_for(parent); } } // namespace dialogs diff --git a/gui/src/dialogs/render.hpp b/gui/src/dialogs/render.hpp index 473699bfa..d515ece96 100644 --- a/gui/src/dialogs/render.hpp +++ b/gui/src/dialogs/render.hpp @@ -28,6 +28,7 @@ #define RENDER_H #include +#include namespace lumiera { namespace gui { @@ -41,7 +42,8 @@ namespace dialogs { public: Render(BaseObjectType* cobject, const Glib::RefPtr& xml); - static void init(const Glib::RefPtr& glade_xml, Render*& dialog); + static void init(Gtk::Window &parent, + const Glib::RefPtr& glade_xml, Render*& dialog); }; } // namespace dialogs diff --git a/gui/src/workspace/actions.cpp b/gui/src/workspace/actions.cpp index a6633b4aa..6f644a458 100644 --- a/gui/src/workspace/actions.cpp +++ b/gui/src/workspace/actions.cpp @@ -85,7 +85,7 @@ namespace workspace { void Actions::on_menu_file_render() { - application().get_render_dialog()->run(); + mainWindow.renderDialog->run(); } void diff --git a/gui/src/workspace/main-window.cpp b/gui/src/workspace/main-window.cpp index 3f1868d03..658057bcc 100644 --- a/gui/src/workspace/main-window.cpp +++ b/gui/src/workspace/main-window.cpp @@ -47,6 +47,7 @@ namespace workspace { : actions(*this) { create_ui(); + create_dialogs(); } MainWindow::~MainWindow() @@ -152,6 +153,22 @@ namespace workspace { gdl_dock_placeholder_new ("ph4", (GdlDockObject*)dock->gobj(), GDL_DOCK_RIGHT, FALSE); } + void + MainWindow::create_dialogs() + { + try + { + gladeXml = Gnome::Glade::Xml::create("gtk-lumiera.glade"); + } + catch(const Gnome::Glade::XmlError& ex) + { + g_message(ex.what().data()); + return; + } + + dialogs::Render::init(*this, gladeXml, renderDialog); + } + } // namespace workspace } // namespace gui } // namespace lumiera diff --git a/gui/src/workspace/main-window.hpp b/gui/src/workspace/main-window.hpp index 1b997623a..526f8df6c 100644 --- a/gui/src/workspace/main-window.hpp +++ b/gui/src/workspace/main-window.hpp @@ -31,6 +31,7 @@ #include #include +#include #include "actions.hpp" @@ -38,6 +39,8 @@ #include "../panels/viewer.hpp" #include "../panels/timeline.hpp" +#include "../dialogs/render.hpp" + using namespace lumiera::gui::panels; namespace lumiera { @@ -55,6 +58,7 @@ namespace workspace { protected: void create_ui(); + void create_dialogs(); /* ===== UI ===== */ protected: @@ -71,6 +75,12 @@ namespace workspace { Assets assets; Viewer viewer; Timeline timeline; + + /* ===== Dialogs ===== */ + protected: + Glib::RefPtr gladeXml; + + dialogs::Render *renderDialog; /* ===== Helpers ===== */ protected: @@ -78,6 +88,8 @@ namespace workspace { * The instantiation of the actions helper class, which * registers and handles user action events */ Actions actions; + + friend class Actions; }; } // namespace workspace From 7f487ed3ec04beac389267b8d7f676872143cfa1 Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Wed, 16 Apr 2008 18:24:11 +0100 Subject: [PATCH 015/110] Added a Help>About about dialog --- gui/src/gtk-lumiera.cpp | 26 -------- gui/src/gtk-lumiera.glade | 3 +- gui/src/gtk-lumiera.hpp | 46 +++++++++----- gui/src/workspace/actions.cpp | 110 +++++++++++++++++++++------------- gui/src/workspace/actions.hpp | 5 +- 5 files changed, 106 insertions(+), 84 deletions(-) diff --git a/gui/src/gtk-lumiera.cpp b/gui/src/gtk-lumiera.cpp index 1a6dfacc5..4dff269b4 100644 --- a/gui/src/gtk-lumiera.cpp +++ b/gui/src/gtk-lumiera.cpp @@ -39,7 +39,6 @@ GtkLumiera the_application; int main (int argc, char *argv[]) { - return the_application.main(argc, argv); } @@ -54,37 +53,12 @@ namespace gui { Main kit(argc, argv); Glib::set_application_name(AppTitle); - - init_ui(); MainWindow main_window; kit.run(main_window); } - dialogs::Render* - GtkLumiera::get_render_dialog() const - { - g_assert(renderDialog != NULL); - return renderDialog; - } - - void - GtkLumiera::init_ui() - { - try - { - gladeXml = Gnome::Glade::Xml::create("gtk-lumiera.glade"); - } - catch(const Gnome::Glade::XmlError& ex) - { - g_message(ex.what().data()); - return; - } - - dialogs::Render::init(gladeXml, renderDialog); - } - GtkLumiera& application() { diff --git a/gui/src/gtk-lumiera.glade b/gui/src/gtk-lumiera.glade index 79e9e3d89..d0c8a28f4 100644 --- a/gui/src/gtk-lumiera.glade +++ b/gui/src/gtk-lumiera.glade @@ -1,10 +1,11 @@ - + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 5 + False GTK_WIN_POS_CENTER_ON_PARENT GDK_WINDOW_TYPE_HINT_DIALOG False diff --git a/gui/src/gtk-lumiera.hpp b/gui/src/gtk-lumiera.hpp index ebfb2056c..6532d2b42 100644 --- a/gui/src/gtk-lumiera.hpp +++ b/gui/src/gtk-lumiera.hpp @@ -28,9 +28,8 @@ #ifndef GTK_LUMIERA_HPP #define GTK_LUMIERA_HPO -#include -#include "dialogs/render.hpp" - +#include + #ifdef ENABLE_NLS # include # define _(String) gettext (String) @@ -47,25 +46,42 @@ namespace lumiera { namespace gui { /** - * The name of the Lumiera application + * The name of the application */ - static const gchar* AppTitle = N_("Lumiera"); + static const gchar* AppTitle = "Lumiera"; + /** + * The version number of the application + */ + static const gchar* AppVersion = N_("0.1-dev"); + + /** + * The copyright of the application + */ + static const gchar* AppCopyright = N_("© 2008 The Lumiera Team"); + + /** + * The website of the application + */ + static const gchar* AppWebsite = "www.lumiera.org"; + + /** + * An alphabetical list of the application's authors + */ + static const gchar* AppAuthors[] = { + "Joel Holdsworth", + "Christian Thaeter", + "Hermann Vosseler", + ""}; + + /** + * The main application class. + */ class GtkLumiera { public: int main(int argc, char *argv[]); - public: - dialogs::Render* get_render_dialog() const; - - private: - void init_ui(); - - private: - Glib::RefPtr gladeXml; - - dialogs::Render *renderDialog; }; /** diff --git a/gui/src/workspace/actions.cpp b/gui/src/workspace/actions.cpp index 6f644a458..fc7b70fde 100644 --- a/gui/src/workspace/actions.cpp +++ b/gui/src/workspace/actions.cpp @@ -24,6 +24,9 @@ #include "actions.hpp" #include "main-window.hpp" +using namespace Gtk; +using namespace Glib; + namespace lumiera { namespace gui { namespace workspace { @@ -31,55 +34,55 @@ namespace workspace { Actions::Actions(MainWindow &main_window) : mainWindow(main_window) { - actionGroup = Gtk::ActionGroup::create(); + actionGroup = Gtk::ActionGroup::create(); - // File|New sub menu: - actionGroup->add(Gtk::Action::create("FileNewStandard", - Gtk::Stock::NEW, "_New", "Create a new file"), - sigc::mem_fun(*this, &Actions::on_menu_file_new_generic)); + // File|New sub menu: + actionGroup->add(Gtk::Action::create("FileNewStandard", + Gtk::Stock::NEW, "_New", "Create a new file"), + sigc::mem_fun(*this, &Actions::on_menu_file_new_generic)); - actionGroup->add(Gtk::Action::create("FileNewFoo", - Gtk::Stock::NEW, "New Foo", "Create a new foo"), - sigc::mem_fun(*this, &Actions::on_menu_file_new_generic)); + actionGroup->add(Gtk::Action::create("FileNewFoo", + Gtk::Stock::NEW, "New Foo", "Create a new foo"), + sigc::mem_fun(*this, &Actions::on_menu_file_new_generic)); - actionGroup->add(Gtk::Action::create("FileNewGoo", - Gtk::Stock::NEW, "_New Goo", "Create a new goo"), - sigc::mem_fun(*this, &Actions::on_menu_file_new_generic)); + actionGroup->add(Gtk::Action::create("FileNewGoo", + Gtk::Stock::NEW, "_New Goo", "Create a new goo"), + sigc::mem_fun(*this, &Actions::on_menu_file_new_generic)); - // File menu: - actionGroup->add(Gtk::Action::create("FileMenu", "File")); - // Sub-menu. - actionGroup->add(Gtk::Action::create("FileNew", Gtk::Stock::NEW)); - actionGroup->add(Gtk::Action::create("FileRender", _("Render...")), - Gtk::AccelKey("R"), - sigc::mem_fun(*this, &Actions::on_menu_file_render)); - actionGroup->add(Gtk::Action::create("FileQuit", Gtk::Stock::QUIT), - sigc::mem_fun(*this, &Actions::on_menu_file_quit)); + // File menu: + actionGroup->add(Gtk::Action::create("FileMenu", "File")); + // Sub-menu. + actionGroup->add(Gtk::Action::create("FileNew", Gtk::Stock::NEW)); + actionGroup->add(Gtk::Action::create("FileRender", _("Render...")), + Gtk::AccelKey("R"), + sigc::mem_fun(*this, &Actions::on_menu_file_render)); + actionGroup->add(Gtk::Action::create("FileQuit", Gtk::Stock::QUIT), + sigc::mem_fun(*this, &Actions::on_menu_file_quit)); - // Edit menu: - actionGroup->add(Gtk::Action::create("EditMenu", "Edit")); - actionGroup->add(Gtk::Action::create("EditCopy", Gtk::Stock::COPY), - sigc::mem_fun(*this, &Actions::on_menu_others)); - actionGroup->add(Gtk::Action::create("EditPaste", Gtk::Stock::PASTE), - sigc::mem_fun(*this, &Actions::on_menu_others)); - actionGroup->add(Gtk::Action::create("EditSomething", "Something"), - Gtk::AccelKey("S"), + // Edit menu: + actionGroup->add(Gtk::Action::create("EditMenu", "Edit")); + actionGroup->add(Gtk::Action::create("EditCopy", Gtk::Stock::COPY), sigc::mem_fun(*this, &Actions::on_menu_others)); + actionGroup->add(Gtk::Action::create("EditPaste", Gtk::Stock::PASTE), + sigc::mem_fun(*this, &Actions::on_menu_others)); + actionGroup->add(Gtk::Action::create("EditSomething", "Something"), + Gtk::AccelKey("S"), + sigc::mem_fun(*this, &Actions::on_menu_others)); - // Choices menu, to demonstrate Radio items - actionGroup->add( Gtk::Action::create("ChoicesMenu", "Choices") ); - Gtk::RadioAction::Group group_userlevel; - m_refChoiceOne = Gtk::RadioAction::create(group_userlevel, "ChoiceOne", "One"); - actionGroup->add(m_refChoiceOne, - sigc::mem_fun(*this, &Actions::on_menu_choices_one) ); - m_refChoiceTwo = Gtk::RadioAction::create(group_userlevel, "ChoiceTwo", "Two"); - actionGroup->add(m_refChoiceTwo, - sigc::mem_fun(*this, &Actions::on_menu_choices_two) ); + // Choices menu, to demonstrate Radio items + actionGroup->add( Gtk::Action::create("ChoicesMenu", "Choices") ); + Gtk::RadioAction::Group group_userlevel; + m_refChoiceOne = Gtk::RadioAction::create(group_userlevel, "ChoiceOne", "One"); + actionGroup->add(m_refChoiceOne, + sigc::mem_fun(*this, &Actions::on_menu_choices_one) ); + m_refChoiceTwo = Gtk::RadioAction::create(group_userlevel, "ChoiceTwo", "Two"); + actionGroup->add(m_refChoiceTwo, + sigc::mem_fun(*this, &Actions::on_menu_choices_two) ); - // Help menu: - actionGroup->add( Gtk::Action::create("HelpMenu", "Help") ); - actionGroup->add( Gtk::Action::create("HelpAbout", Gtk::Stock::HELP), - sigc::mem_fun(*this, &Actions::on_menu_others) ); + // Help menu: + actionGroup->add( Gtk::Action::create("HelpMenu", "Help") ); + actionGroup->add( Gtk::Action::create("HelpAbout", Gtk::Stock::ABOUT), + sigc::mem_fun(*this, &Actions::on_menu_help_about) ); } void @@ -94,6 +97,31 @@ namespace workspace { mainWindow.hide(); // Closes the main window to stop the Gtk::Main::run(). } + void + Actions::on_menu_help_about() + { + // Configure the about dialog + AboutDialog dialog; + + dialog.set_program_name(AppTitle); + dialog.set_version(AppVersion); + //dialog.set_version(Appconfig::get("version")); + dialog.set_copyright(AppCopyright); + dialog.set_website(AppWebsite); + dialog.set_authors(StringArrayHandle(AppAuthors, + sizeof(AppAuthors) / sizeof(gchar*), + OWNERSHIP_NONE)); + + dialog.set_transient_for(mainWindow); + + // Show the about dialog + dialog.run(); + } + + + + //----- Temporary junk + void Actions::on_menu_file_new_generic() { diff --git a/gui/src/workspace/actions.hpp b/gui/src/workspace/actions.hpp index a552be90e..7c8c1d89e 100644 --- a/gui/src/workspace/actions.hpp +++ b/gui/src/workspace/actions.hpp @@ -55,8 +55,11 @@ class MainWindow; void on_menu_file_new_generic(); void on_menu_file_render(); void on_menu_file_quit(); - void on_menu_others(); + void on_menu_help_about(); + + // Temporary Junk + void on_menu_others(); void on_menu_choices_one(); void on_menu_choices_two(); From aa5580057292dbb4718cfca7c76b7f1d1aeed353 Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Wed, 16 Apr 2008 19:48:54 +0100 Subject: [PATCH 016/110] Modified menus to remove dummy example code, and add real file items --- gui/src/workspace/actions.cpp | 85 ++++++++----------------------- gui/src/workspace/actions.hpp | 5 +- gui/src/workspace/main-window.cpp | 14 ++--- 3 files changed, 26 insertions(+), 78 deletions(-) diff --git a/gui/src/workspace/actions.cpp b/gui/src/workspace/actions.cpp index fc7b70fde..e91ab9ff1 100644 --- a/gui/src/workspace/actions.cpp +++ b/gui/src/workspace/actions.cpp @@ -36,48 +36,24 @@ namespace workspace { { actionGroup = Gtk::ActionGroup::create(); - // File|New sub menu: - actionGroup->add(Gtk::Action::create("FileNewStandard", - Gtk::Stock::NEW, "_New", "Create a new file"), - sigc::mem_fun(*this, &Actions::on_menu_file_new_generic)); - - actionGroup->add(Gtk::Action::create("FileNewFoo", - Gtk::Stock::NEW, "New Foo", "Create a new foo"), - sigc::mem_fun(*this, &Actions::on_menu_file_new_generic)); - - actionGroup->add(Gtk::Action::create("FileNewGoo", - Gtk::Stock::NEW, "_New Goo", "Create a new goo"), - sigc::mem_fun(*this, &Actions::on_menu_file_new_generic)); - // File menu: - actionGroup->add(Gtk::Action::create("FileMenu", "File")); - // Sub-menu. - actionGroup->add(Gtk::Action::create("FileNew", Gtk::Stock::NEW)); - actionGroup->add(Gtk::Action::create("FileRender", _("Render...")), + actionGroup->add(Gtk::Action::create("FileMenu", _("File"))); + actionGroup->add(Gtk::Action::create("FileNewProject", Gtk::Stock::NEW, _("_New Project...")), + sigc::mem_fun(*this, &Actions::on_menu_file_new_project)); + actionGroup->add(Gtk::Action::create("FileOpenProject", Gtk::Stock::OPEN, _("_Open Project...")), + sigc::mem_fun(*this, &Actions::on_menu_file_new_project)); + actionGroup->add(Gtk::Action::create("FileRender", _("_Render...")), Gtk::AccelKey("R"), sigc::mem_fun(*this, &Actions::on_menu_file_render)); actionGroup->add(Gtk::Action::create("FileQuit", Gtk::Stock::QUIT), sigc::mem_fun(*this, &Actions::on_menu_file_quit)); // Edit menu: - actionGroup->add(Gtk::Action::create("EditMenu", "Edit")); + actionGroup->add(Gtk::Action::create("EditMenu", _("Edit"))); actionGroup->add(Gtk::Action::create("EditCopy", Gtk::Stock::COPY), - sigc::mem_fun(*this, &Actions::on_menu_others)); - actionGroup->add(Gtk::Action::create("EditPaste", Gtk::Stock::PASTE), - sigc::mem_fun(*this, &Actions::on_menu_others)); - actionGroup->add(Gtk::Action::create("EditSomething", "Something"), - Gtk::AccelKey("S"), sigc::mem_fun(*this, &Actions::on_menu_others)); - - // Choices menu, to demonstrate Radio items - actionGroup->add( Gtk::Action::create("ChoicesMenu", "Choices") ); - Gtk::RadioAction::Group group_userlevel; - m_refChoiceOne = Gtk::RadioAction::create(group_userlevel, "ChoiceOne", "One"); - actionGroup->add(m_refChoiceOne, - sigc::mem_fun(*this, &Actions::on_menu_choices_one) ); - m_refChoiceTwo = Gtk::RadioAction::create(group_userlevel, "ChoiceTwo", "Two"); - actionGroup->add(m_refChoiceTwo, - sigc::mem_fun(*this, &Actions::on_menu_choices_two) ); + actionGroup->add(Gtk::Action::create("EditPaste", Gtk::Stock::PASTE), + sigc::mem_fun(*this, &Actions::on_menu_others)); // Help menu: actionGroup->add( Gtk::Action::create("HelpMenu", "Help") ); @@ -85,6 +61,18 @@ namespace workspace { sigc::mem_fun(*this, &Actions::on_menu_help_about) ); } + void + Actions::on_menu_file_new_project() + { + g_message("A File|New menu item was selecteda."); + } + + void + Actions::on_menu_file_open_project() + { + g_message("A File|Open menu item was selecteda."); + } + void Actions::on_menu_file_render() { @@ -121,43 +109,12 @@ namespace workspace { //----- Temporary junk - - void - Actions::on_menu_file_new_generic() - { - g_message("A File|New menu item was selecteda."); - } - void Actions::on_menu_others() { g_message("A menu item was selected."); } - void - Actions::on_menu_choices_one() - { - Glib::ustring message; - //if(m_refChoiceOne->get_active()) - // message = "Choice 1 was selected."; - //else - message = "Choice 1 was deselected"; - - g_message(message.c_str()); - } - - void - Actions::on_menu_choices_two() - { - Glib::ustring message; - //if(_main_window.m_refChoiceTwo->get_active()) - // message = "Choice 2 was selected."; - //else - message = "Choice 2 was deselected"; - - g_message(message.c_str()); - } - } // namespace workspace } // namespace gui } // namespace lumiera diff --git a/gui/src/workspace/actions.hpp b/gui/src/workspace/actions.hpp index 7c8c1d89e..2f24517c9 100644 --- a/gui/src/workspace/actions.hpp +++ b/gui/src/workspace/actions.hpp @@ -52,7 +52,8 @@ class MainWindow; MainWindow &mainWindow; /* ===== Event Handlers ===== */ - void on_menu_file_new_generic(); + void on_menu_file_new_project(); + void on_menu_file_open_project(); void on_menu_file_render(); void on_menu_file_quit(); @@ -60,8 +61,6 @@ class MainWindow; // Temporary Junk void on_menu_others(); - void on_menu_choices_one(); - void on_menu_choices_two(); /* ===== Actions ===== */ Glib::RefPtr actionGroup; diff --git a/gui/src/workspace/main-window.cpp b/gui/src/workspace/main-window.cpp index 658057bcc..1a57934e6 100644 --- a/gui/src/workspace/main-window.cpp +++ b/gui/src/workspace/main-window.cpp @@ -75,11 +75,8 @@ namespace workspace { "" " " " " - " " - " " - " " - " " - " " + " " + " " " " " " " " @@ -88,18 +85,13 @@ namespace workspace { " " " " " " - " " - " " - " " - " " - " " " " " " " " " " " " " " - " " + " " " " ""; From e59d3b6e356cf6fa14e667627968c7ce1c8c6a66 Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Wed, 16 Apr 2008 22:50:01 +0100 Subject: [PATCH 017/110] Excised glade, and recreated Render dialog in C++ --- gui/configure.ac | 2 +- gui/src/Makefile.am | 5 +- gui/src/dialogs/render.cpp | 74 ++++++++++++-- gui/src/dialogs/render.hpp | 34 ++++++- gui/src/gtk-lumiera.glade | 157 ------------------------------ gui/src/workspace/actions.cpp | 32 +++--- gui/src/workspace/main-window.cpp | 20 +--- gui/src/workspace/main-window.hpp | 12 +-- 8 files changed, 120 insertions(+), 216 deletions(-) delete mode 100644 gui/src/gtk-lumiera.glade diff --git a/gui/configure.ac b/gui/configure.ac index 170dcc687..a858cf3ce 100644 --- a/gui/configure.ac +++ b/gui/configure.ac @@ -30,7 +30,7 @@ AM_PROG_LIBTOOL -PKG_CHECK_MODULES(GTK_LUMIERA, [gtkmm-2.4 >= 2.8 libglademm-2.4 >= 2.6 gdl-1.0 >= 0.7.6]) +PKG_CHECK_MODULES(GTK_LUMIERA, [gtkmm-2.4 >= 2.8 gdl-1.0 >= 0.7.6]) AC_SUBST(GTK_LUMIERA_CFLAGS) AC_SUBST(GTK_LUMIERA_LIBS) diff --git a/gui/src/Makefile.am b/gui/src/Makefile.am index eda59746e..e35cf0494 100644 --- a/gui/src/Makefile.am +++ b/gui/src/Makefile.am @@ -1,8 +1,5 @@ ## Process this file with automake to produce Makefile.in -gladedir = $(datadir)/gtk-lumiera/glade -glade_DATA = gtk-lumiera.glade - INCLUDES = \ -DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \ -DPACKAGE_SRC_DIR=\""$(srcdir)"\" \ @@ -39,6 +36,6 @@ gtk_lumiera_LDFLAGS = gtk_lumiera_LDADD = $(GTK_LUMIERA_LIBS) -EXTRA_DIST = $(glade_DATA) +EXTRA_DIST = diff --git a/gui/src/dialogs/render.cpp b/gui/src/dialogs/render.cpp index 48423ebb0..958b2d229 100644 --- a/gui/src/dialogs/render.cpp +++ b/gui/src/dialogs/render.cpp @@ -20,26 +20,86 @@ * *****************************************************/ +#include "../gtk-lumiera.hpp" + #include "render.hpp" +using namespace Gtk; + namespace lumiera { namespace gui { namespace dialogs { - Render::Render(BaseObjectType* cobject, const Glib::RefPtr& xml) : - Gtk::Dialog(cobject) + Render::Render(Window &parent) : + Dialog(_("Render"), parent, true), + outputFileLabel(_("Output File:")), + browseButtonImage(StockID(Stock::INDEX), ICON_SIZE_BUTTON), + browseButtonLabel(_("_Browse..."), true), + containerFormatLabel(_("Container Format:")), + cancelButton(Stock::CANCEL), + renderButtonImage(StockID(Stock::APPLY), ICON_SIZE_BUTTON), + renderButtonLabel(_("_Render"), true) { + VBox *v_box = get_vbox(); + g_assert(v_box != NULL); + + // The Output File Row + outputFileHBox.pack_start(outputFileLabel, PACK_SHRINK); + outputFileHBox.pack_start(outputFilePathEntry); + + browseButtonHBox.pack_start(browseButtonImage); + browseButtonHBox.pack_start(browseButtonLabel); + outputFileBrowseButton.add(browseButtonHBox); + + outputFileHBox.pack_start(outputFileBrowseButton, PACK_SHRINK); + outputFileHBox.set_spacing(4); + v_box->pack_start(outputFileHBox, PACK_SHRINK); + + // The Containter Format Row + containerFormatHBox.pack_start(containerFormatLabel, PACK_SHRINK); + containerFormatHBox.pack_start(containerFormat); + containerFormatHBox.set_spacing(4); + v_box->pack_start(containerFormatHBox, PACK_SHRINK); + + // Configure the dialog + v_box->set_spacing(4); + set_border_width(5); + set_resizable(false); + + // Configure the Cancel and Render buttons + Gtk::Box* action_area = get_action_area(); + g_assert(action_area != NULL); + cancelButton.signal_clicked().connect( + sigc::mem_fun(*this, &Render::on_button_cancel)); + action_area->pack_start(cancelButton); + + renderButtonHBox.pack_start(renderButtonImage); + renderButtonHBox.pack_start(renderButtonLabel); + renderButton.add(renderButtonHBox); + renderButton.signal_clicked().connect( + sigc::mem_fun(*this, &Render::on_button_render)); + renderButton.set_flags(Gtk::CAN_DEFAULT); + action_area->pack_start(renderButton); + renderButton.grab_default(); + + show_all_children(); } - void - Render::init(Gtk::Window &parent, - const Glib::RefPtr& glade_xml, Render*& dialog) + void Render::on_button_render() { - glade_xml->get_widget_derived("Render", dialog); - if(dialog != NULL) dialog->set_transient_for(parent); + g_message("render"); + hide(); } + void Render::on_button_cancel() + { + g_message("cancel"); + hide(); + } + + + } // namespace dialogs } // namespace gui } // namespace lumiera diff --git a/gui/src/dialogs/render.hpp b/gui/src/dialogs/render.hpp index d515ece96..e1a501573 100644 --- a/gui/src/dialogs/render.hpp +++ b/gui/src/dialogs/render.hpp @@ -28,7 +28,8 @@ #define RENDER_H #include -#include + +using namespace Gtk; namespace lumiera { namespace gui { @@ -37,13 +38,36 @@ namespace dialogs { /** * The defintion of render output dialog class */ - class Render : public Gtk::Dialog + class Render : public Dialog { public: - Render(BaseObjectType* cobject, const Glib::RefPtr& xml); + Render(Window &parent); - static void init(Gtk::Window &parent, - const Glib::RefPtr& glade_xml, Render*& dialog); + protected: + void on_button_render(); + + void on_button_cancel(); + + protected: + HBox outputFileHBox; + Label outputFileLabel; + Entry outputFilePathEntry; + + HBox browseButtonHBox; + Image browseButtonImage; + Label browseButtonLabel; + Button outputFileBrowseButton; + + HBox containerFormatHBox; + Label containerFormatLabel; + ComboBox containerFormat; + + Button cancelButton; + + HBox renderButtonHBox; + Image renderButtonImage; + Label renderButtonLabel; + Button renderButton; }; } // namespace dialogs diff --git a/gui/src/gtk-lumiera.glade b/gui/src/gtk-lumiera.glade deleted file mode 100644 index d0c8a28f4..000000000 --- a/gui/src/gtk-lumiera.glade +++ /dev/null @@ -1,157 +0,0 @@ - - - - - - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 5 - False - GTK_WIN_POS_CENTER_ON_PARENT - GDK_WINDOW_TYPE_HINT_DIALOG - False - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 2 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 4 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 4 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Output File: - - - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - gtk-open - True - 0 - - - False - 2 - - - - - False - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 4 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Container Format: - - - False - False - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - False - 1 - - - - - - - - - - - - - - - - - - - - 1 - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - GTK_BUTTONBOX_END - - - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - gtk-cancel - True - 0 - - - - - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - gtk-ok - True - 0 - - - 1 - - - - - False - GTK_PACK_END - - - - - - diff --git a/gui/src/workspace/actions.cpp b/gui/src/workspace/actions.cpp index e91ab9ff1..b08de0b0d 100644 --- a/gui/src/workspace/actions.cpp +++ b/gui/src/workspace/actions.cpp @@ -24,8 +24,11 @@ #include "actions.hpp" #include "main-window.hpp" +#include "../dialogs/render.hpp" + using namespace Gtk; using namespace Glib; +using namespace lumiera::gui; namespace lumiera { namespace gui { @@ -34,33 +37,35 @@ namespace workspace { Actions::Actions(MainWindow &main_window) : mainWindow(main_window) { - actionGroup = Gtk::ActionGroup::create(); + actionGroup = ActionGroup::create(); // File menu: - actionGroup->add(Gtk::Action::create("FileMenu", _("File"))); - actionGroup->add(Gtk::Action::create("FileNewProject", Gtk::Stock::NEW, _("_New Project...")), + actionGroup->add(Action::create("FileMenu", _("_File"))); + actionGroup->add(Action::create("FileNewProject", Stock::NEW, _("_New Project...")), sigc::mem_fun(*this, &Actions::on_menu_file_new_project)); - actionGroup->add(Gtk::Action::create("FileOpenProject", Gtk::Stock::OPEN, _("_Open Project...")), - sigc::mem_fun(*this, &Actions::on_menu_file_new_project)); - actionGroup->add(Gtk::Action::create("FileRender", _("_Render...")), + actionGroup->add(Action::create("FileOpenProject", Stock::OPEN, _("_Open Project...")), + sigc::mem_fun(*this, &Actions::on_menu_file_open_project)); + actionGroup->add(Action::create("FileRender", _("_Render...")), Gtk::AccelKey("R"), sigc::mem_fun(*this, &Actions::on_menu_file_render)); - actionGroup->add(Gtk::Action::create("FileQuit", Gtk::Stock::QUIT), + actionGroup->add(Action::create("FileQuit", Stock::QUIT), sigc::mem_fun(*this, &Actions::on_menu_file_quit)); // Edit menu: - actionGroup->add(Gtk::Action::create("EditMenu", _("Edit"))); - actionGroup->add(Gtk::Action::create("EditCopy", Gtk::Stock::COPY), + actionGroup->add(Action::create("EditMenu", _("_Edit"))); + actionGroup->add(Action::create("EditCopy", Stock::COPY), sigc::mem_fun(*this, &Actions::on_menu_others)); - actionGroup->add(Gtk::Action::create("EditPaste", Gtk::Stock::PASTE), + actionGroup->add(Action::create("EditPaste", Stock::PASTE), sigc::mem_fun(*this, &Actions::on_menu_others)); // Help menu: - actionGroup->add( Gtk::Action::create("HelpMenu", "Help") ); - actionGroup->add( Gtk::Action::create("HelpAbout", Gtk::Stock::ABOUT), + actionGroup->add(Action::create("HelpMenu", _("_Help")) ); + actionGroup->add(Action::create("HelpAbout", Stock::ABOUT), sigc::mem_fun(*this, &Actions::on_menu_help_about) ); } + /* ===== File Menu Event Handlers ===== */ + void Actions::on_menu_file_new_project() { @@ -76,7 +81,8 @@ namespace workspace { void Actions::on_menu_file_render() { - mainWindow.renderDialog->run(); + dialogs::Render dialog(mainWindow); + dialog.run(); } void diff --git a/gui/src/workspace/main-window.cpp b/gui/src/workspace/main-window.cpp index 1a57934e6..db55282ed 100644 --- a/gui/src/workspace/main-window.cpp +++ b/gui/src/workspace/main-window.cpp @@ -47,7 +47,6 @@ namespace workspace { : actions(*this) { create_ui(); - create_dialogs(); } MainWindow::~MainWindow() @@ -62,7 +61,7 @@ namespace workspace { set_default_size(1024, 768); //----- Set up the UI Manager -----// - // The UI will be nested within a VBOX + // The UI will be nested within a VBox add(base_container); uiManager = Gtk::UIManager::create(); @@ -92,6 +91,7 @@ namespace workspace { " " " " " " + " " " " ""; @@ -145,22 +145,6 @@ namespace workspace { gdl_dock_placeholder_new ("ph4", (GdlDockObject*)dock->gobj(), GDL_DOCK_RIGHT, FALSE); } - void - MainWindow::create_dialogs() - { - try - { - gladeXml = Gnome::Glade::Xml::create("gtk-lumiera.glade"); - } - catch(const Gnome::Glade::XmlError& ex) - { - g_message(ex.what().data()); - return; - } - - dialogs::Render::init(*this, gladeXml, renderDialog); - } - } // namespace workspace } // namespace gui } // namespace lumiera diff --git a/gui/src/workspace/main-window.hpp b/gui/src/workspace/main-window.hpp index 526f8df6c..c544ce5b0 100644 --- a/gui/src/workspace/main-window.hpp +++ b/gui/src/workspace/main-window.hpp @@ -31,7 +31,6 @@ #include #include -#include #include "actions.hpp" @@ -39,8 +38,6 @@ #include "../panels/viewer.hpp" #include "../panels/timeline.hpp" -#include "../dialogs/render.hpp" - using namespace lumiera::gui::panels; namespace lumiera { @@ -58,7 +55,6 @@ namespace workspace { protected: void create_ui(); - void create_dialogs(); /* ===== UI ===== */ protected: @@ -75,13 +71,7 @@ namespace workspace { Assets assets; Viewer viewer; Timeline timeline; - - /* ===== Dialogs ===== */ - protected: - Glib::RefPtr gladeXml; - - dialogs::Render *renderDialog; - + /* ===== Helpers ===== */ protected: /** From a3bd7c35fae3006bf4e00466f70aa42548a49d70 Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Wed, 16 Apr 2008 22:59:46 +0100 Subject: [PATCH 018/110] Added 2 frames to the render dialog --- gui/src/dialogs/render.cpp | 7 ++++++- gui/src/dialogs/render.hpp | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/gui/src/dialogs/render.cpp b/gui/src/dialogs/render.cpp index 958b2d229..af6c5b631 100644 --- a/gui/src/dialogs/render.cpp +++ b/gui/src/dialogs/render.cpp @@ -38,7 +38,9 @@ namespace dialogs { containerFormatLabel(_("Container Format:")), cancelButton(Stock::CANCEL), renderButtonImage(StockID(Stock::APPLY), ICON_SIZE_BUTTON), - renderButtonLabel(_("_Render"), true) + renderButtonLabel(_("_Render"), true), + audioFrame(_("Audio")), + videoFrame(_("Video")) { VBox *v_box = get_vbox(); g_assert(v_box != NULL); @@ -61,6 +63,9 @@ namespace dialogs { containerFormatHBox.set_spacing(4); v_box->pack_start(containerFormatHBox, PACK_SHRINK); + v_box->pack_start(audioFrame); + v_box->pack_start(videoFrame); + // Configure the dialog v_box->set_spacing(4); set_border_width(5); diff --git a/gui/src/dialogs/render.hpp b/gui/src/dialogs/render.hpp index e1a501573..4e7a57d50 100644 --- a/gui/src/dialogs/render.hpp +++ b/gui/src/dialogs/render.hpp @@ -62,6 +62,10 @@ namespace dialogs { Label containerFormatLabel; ComboBox containerFormat; + Frame audioFrame; + + Frame videoFrame; + Button cancelButton; HBox renderButtonHBox; From b042349936634d8f98332258f741bc392949e3bb Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Thu, 17 Apr 2008 18:06:00 +0100 Subject: [PATCH 019/110] Improved code for buttons --- gui/src/dialogs/render.cpp | 59 ++++++++++++++++---------------------- gui/src/dialogs/render.hpp | 11 +------ 2 files changed, 26 insertions(+), 44 deletions(-) diff --git a/gui/src/dialogs/render.cpp b/gui/src/dialogs/render.cpp index af6c5b631..f785ed6a4 100644 --- a/gui/src/dialogs/render.cpp +++ b/gui/src/dialogs/render.cpp @@ -34,11 +34,9 @@ namespace dialogs { Dialog(_("Render"), parent, true), outputFileLabel(_("Output File:")), browseButtonImage(StockID(Stock::INDEX), ICON_SIZE_BUTTON), - browseButtonLabel(_("_Browse..."), true), + outputFileBrowseButton(_("_Browse...")), containerFormatLabel(_("Container Format:")), - cancelButton(Stock::CANCEL), - renderButtonImage(StockID(Stock::APPLY), ICON_SIZE_BUTTON), - renderButtonLabel(_("_Render"), true), + renderButtonImage(StockID(Stock::OK), ICON_SIZE_BUTTON), audioFrame(_("Audio")), videoFrame(_("Video")) { @@ -49,15 +47,15 @@ namespace dialogs { outputFileHBox.pack_start(outputFileLabel, PACK_SHRINK); outputFileHBox.pack_start(outputFilePathEntry); - browseButtonHBox.pack_start(browseButtonImage); - browseButtonHBox.pack_start(browseButtonLabel); - outputFileBrowseButton.add(browseButtonHBox); + outputFileBrowseButton.set_image(browseButtonImage); + outputFileBrowseButton.signal_clicked().connect( + sigc::mem_fun(*this, &Render::on_button_browse)); outputFileHBox.pack_start(outputFileBrowseButton, PACK_SHRINK); outputFileHBox.set_spacing(4); v_box->pack_start(outputFileHBox, PACK_SHRINK); - // The Containter Format Row + // The Container Format Row containerFormatHBox.pack_start(containerFormatLabel, PACK_SHRINK); containerFormatHBox.pack_start(containerFormat); containerFormatHBox.set_spacing(4); @@ -71,40 +69,33 @@ namespace dialogs { set_border_width(5); set_resizable(false); - // Configure the Cancel and Render buttons - Gtk::Box* action_area = get_action_area(); - g_assert(action_area != NULL); - - cancelButton.signal_clicked().connect( - sigc::mem_fun(*this, &Render::on_button_cancel)); - action_area->pack_start(cancelButton); + // Configure the Cancel and Render buttons + add_button(Stock::CANCEL, RESPONSE_CANCEL); - renderButtonHBox.pack_start(renderButtonImage); - renderButtonHBox.pack_start(renderButtonLabel); - renderButton.add(renderButtonHBox); - renderButton.signal_clicked().connect( - sigc::mem_fun(*this, &Render::on_button_render)); - renderButton.set_flags(Gtk::CAN_DEFAULT); - action_area->pack_start(renderButton); - renderButton.grab_default(); + Button *render_button = add_button(Stock::OK, RESPONSE_OK); + render_button->set_label(_("_Render")); + render_button->set_image(renderButtonImage); + render_button->set_flags(Gtk::CAN_DEFAULT); + render_button->grab_default(); show_all_children(); } - void Render::on_button_render() + void Render::on_button_browse() { - g_message("render"); - hide(); + FileChooserDialog dialog(*this, _("Select a File Name for Rendering"), + FILE_CHOOSER_ACTION_SAVE); + + // Add response buttons the the dialog: + dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); + dialog.add_button(/*Gtk::Stock::SAVE*/"Save", Gtk::RESPONSE_OK); + + int result = dialog.run(); + g_message("%d", result); + if(result == RESPONSE_OK) + g_message("RESPONSE_OK"); } - void Render::on_button_cancel() - { - g_message("cancel"); - hide(); - } - - - } // namespace dialogs } // namespace gui } // namespace lumiera diff --git a/gui/src/dialogs/render.hpp b/gui/src/dialogs/render.hpp index 4e7a57d50..1474afe31 100644 --- a/gui/src/dialogs/render.hpp +++ b/gui/src/dialogs/render.hpp @@ -44,18 +44,14 @@ namespace dialogs { Render(Window &parent); protected: - void on_button_render(); - - void on_button_cancel(); + void on_button_browse(); protected: HBox outputFileHBox; Label outputFileLabel; Entry outputFilePathEntry; - HBox browseButtonHBox; Image browseButtonImage; - Label browseButtonLabel; Button outputFileBrowseButton; HBox containerFormatHBox; @@ -66,12 +62,7 @@ namespace dialogs { Frame videoFrame; - Button cancelButton; - - HBox renderButtonHBox; Image renderButtonImage; - Label renderButtonLabel; - Button renderButton; }; } // namespace dialogs From 3fc585de25ab29f8f5a976aa7fabf63b466e6f9b Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Fri, 18 Apr 2008 20:09:14 +0100 Subject: [PATCH 020/110] Reduced required gdl version number --- gui/configure.ac | 2 +- gui/src/workspace/main-window.cpp | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/gui/configure.ac b/gui/configure.ac index a858cf3ce..004b4ca93 100644 --- a/gui/configure.ac +++ b/gui/configure.ac @@ -30,7 +30,7 @@ AM_PROG_LIBTOOL -PKG_CHECK_MODULES(GTK_LUMIERA, [gtkmm-2.4 >= 2.8 gdl-1.0 >= 0.7.6]) +PKG_CHECK_MODULES(GTK_LUMIERA, [gtkmm-2.4 >= 2.8 gdl-1.0 >= 0.6.1]) AC_SUBST(GTK_LUMIERA_CFLAGS) AC_SUBST(GTK_LUMIERA_LIBS) diff --git a/gui/src/workspace/main-window.cpp b/gui/src/workspace/main-window.cpp index db55282ed..f4578794d 100644 --- a/gui/src/workspace/main-window.cpp +++ b/gui/src/workspace/main-window.cpp @@ -29,10 +29,8 @@ #include #include #include -#include #include #include -#include #include "gtk-lumiera.hpp" #include "main-window.hpp" From 82daa28f3aba5826bb361c225b485708f67cacb7 Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Fri, 18 Apr 2008 21:35:10 +0100 Subject: [PATCH 021/110] Made some changes to make the gui work better with debian etch --- gui/configure.ac | 2 +- gui/src/widgets/video-display.cpp | 4 +--- gui/src/workspace/actions.cpp | 2 +- gui/src/workspace/main-window.cpp | 1 - 4 files changed, 3 insertions(+), 6 deletions(-) diff --git a/gui/configure.ac b/gui/configure.ac index 004b4ca93..fbc00ed01 100644 --- a/gui/configure.ac +++ b/gui/configure.ac @@ -30,7 +30,7 @@ AM_PROG_LIBTOOL -PKG_CHECK_MODULES(GTK_LUMIERA, [gtkmm-2.4 >= 2.8 gdl-1.0 >= 0.6.1]) +PKG_CHECK_MODULES(GTK_LUMIERA, [gtkmm-2.4 >= 2.8 gdl-1.0 >= 0.6.1 cairomm-1.0 >= 0.6.0]) AC_SUBST(GTK_LUMIERA_CFLAGS) AC_SUBST(GTK_LUMIERA_LIBS) diff --git a/gui/src/widgets/video-display.cpp b/gui/src/widgets/video-display.cpp index 4ec1eada5..29d95268d 100644 --- a/gui/src/widgets/video-display.cpp +++ b/gui/src/widgets/video-display.cpp @@ -22,6 +22,7 @@ #include #include +#include #include "video-display.hpp" @@ -49,9 +50,6 @@ VideoDisplay::on_expose_event(GdkEventExpose* event) Glib::RefPtr window = get_window(); if(window) { - double scale_x = 1; - double scale_y = 1; - Cairo::RefPtr cr = window->create_cairo_context(); if(event) { diff --git a/gui/src/workspace/actions.cpp b/gui/src/workspace/actions.cpp index b08de0b0d..2303b1000 100644 --- a/gui/src/workspace/actions.cpp +++ b/gui/src/workspace/actions.cpp @@ -97,7 +97,7 @@ namespace workspace { // Configure the about dialog AboutDialog dialog; - dialog.set_program_name(AppTitle); + //dialog.set_program_name(AppTitle); dialog.set_version(AppVersion); //dialog.set_version(Appconfig::get("version")); dialog.set_copyright(AppCopyright); diff --git a/gui/src/workspace/main-window.cpp b/gui/src/workspace/main-window.cpp index f4578794d..b3b728353 100644 --- a/gui/src/workspace/main-window.cpp +++ b/gui/src/workspace/main-window.cpp @@ -120,7 +120,6 @@ namespace workspace { layout = gdl_dock_layout_new((GdlDock*)dock->gobj()); dockbar = Glib::wrap(gdl_dock_bar_new ((GdlDock*)dock->gobj())); - gdl_dock_bar_set_style((GdlDockBar*)dockbar->gobj(), GDL_DOCK_BAR_TEXT); dock_container.pack_start(*dockbar, PACK_SHRINK); dock_container.pack_end(*dock, PACK_EXPAND_WIDGET); From f360ead450a55970c669307b0b2c967adb14c129 Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Sat, 19 Apr 2008 18:21:20 +0100 Subject: [PATCH 022/110] Converted some _Hs to _HPPs in header gates --- gui/src/panels/assets.hpp | 6 +++--- gui/src/panels/panel.hpp | 6 +++--- gui/src/panels/viewer.hpp | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/gui/src/panels/assets.hpp b/gui/src/panels/assets.hpp index 1a11107d9..f6d1d5544 100644 --- a/gui/src/panels/assets.hpp +++ b/gui/src/panels/assets.hpp @@ -23,8 +23,8 @@ ** This file contains the definition of the assets panel */ -#ifndef ASSETS_H -#define ASSETS_H +#ifndef ASSETS_HPP +#define ASSETS_HPP #include "panel.hpp" @@ -45,4 +45,4 @@ namespace panels { } // namespace gui } // namespace lumiera -#endif // ASSETS_H +#endif // ASSETS_HPP diff --git a/gui/src/panels/panel.hpp b/gui/src/panels/panel.hpp index fdb7296cf..05cc47dc6 100644 --- a/gui/src/panels/panel.hpp +++ b/gui/src/panels/panel.hpp @@ -24,8 +24,8 @@ ** for all docking panels */ -#ifndef PANEL_H -#define PANEL_H +#ifndef PANEL_HPP +#define PANEL_HPP #include #include @@ -56,4 +56,4 @@ namespace panels { } // namespace gui } // namespace lumiera -#endif // PANEL_H +#endif // PANEL_HPP diff --git a/gui/src/panels/viewer.hpp b/gui/src/panels/viewer.hpp index e6d459ffa..fb6d77760 100644 --- a/gui/src/panels/viewer.hpp +++ b/gui/src/panels/viewer.hpp @@ -23,8 +23,8 @@ ** This file contains the definition of the viewer panel */ -#ifndef VIEWER_H -#define VIEWER_H +#ifndef VIEWER_HPP +#define VIEWER_HPP #include @@ -59,4 +59,4 @@ namespace panels { } // namespace gui } // namespace lumiera -#endif // VIEWER_H +#endif // VIEWER_HPP From 82a000662ba0ff69f5b75a9f98a2df87b47655c1 Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Sat, 19 Apr 2008 19:15:59 +0100 Subject: [PATCH 023/110] Added the data model of a project --- gui/src/Makefile.am | 8 ++-- gui/src/gtk-lumiera.cpp | 9 ++-- gui/src/model/project.cpp | 38 ++++++++++++++++ gui/src/model/project.hpp | 44 +++++++++++++++++++ gui/src/workspace/actions.cpp | 12 ++--- gui/src/workspace/actions.hpp | 8 ++-- .../{main-window.cpp => workspace-window.cpp} | 17 ++++--- .../{main-window.hpp => workspace-window.hpp} | 33 +++++++++----- 8 files changed, 135 insertions(+), 34 deletions(-) create mode 100644 gui/src/model/project.cpp create mode 100644 gui/src/model/project.hpp rename gui/src/workspace/{main-window.cpp => workspace-window.cpp} (91%) rename gui/src/workspace/{main-window.hpp => workspace-window.hpp} (78%) diff --git a/gui/src/Makefile.am b/gui/src/Makefile.am index e35cf0494..59ca02604 100644 --- a/gui/src/Makefile.am +++ b/gui/src/Makefile.am @@ -17,8 +17,8 @@ gtk_lumiera_SOURCES = \ gtk-lumiera.hpp \ workspace/actions.cpp \ workspace/actions.hpp \ - workspace/main-window.cpp \ - workspace/main-window.hpp \ + workspace/workspace-window.cpp \ + workspace/workspace-window.hpp \ dialogs/render.cpp \ dialogs/render.hpp \ panels/panel.cpp \ @@ -30,7 +30,9 @@ gtk_lumiera_SOURCES = \ panels/assets.cpp \ panels/assets.hpp \ widgets/video-display.cpp \ - widgets/video-display.hpp + widgets/video-display.hpp \ + model/project.cpp \ + model/project.hpp gtk_lumiera_LDFLAGS = diff --git a/gui/src/gtk-lumiera.cpp b/gui/src/gtk-lumiera.cpp index 4dff269b4..a7951b3a0 100644 --- a/gui/src/gtk-lumiera.cpp +++ b/gui/src/gtk-lumiera.cpp @@ -28,11 +28,13 @@ #endif #include "gtk-lumiera.hpp" -#include "workspace/main-window.hpp" +#include "workspace/workspace-window.hpp" +#include "model/project.hpp" +using namespace Gtk; using namespace lumiera::gui; using namespace lumiera::gui::workspace; -using namespace Gtk; +using namespace lumiera::gui::model; GtkLumiera the_application; @@ -54,7 +56,8 @@ namespace gui { Glib::set_application_name(AppTitle); - MainWindow main_window; + Project project; + WorkspaceWindow main_window(&project); kit.run(main_window); } diff --git a/gui/src/model/project.cpp b/gui/src/model/project.cpp new file mode 100644 index 000000000..345398c7a --- /dev/null +++ b/gui/src/model/project.cpp @@ -0,0 +1,38 @@ +/* + panel.cpp - Implementation of the Project class + + Copyright (C) Lumiera.org + 2008, Joel Holdsworth + + 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 "project.hpp" + +namespace lumiera { +namespace gui { +namespace model { + +Project::Project() +{ + +} + +} // namespace model +} // namespace gui +} // namespace lumiera + + diff --git a/gui/src/model/project.hpp b/gui/src/model/project.hpp new file mode 100644 index 000000000..c7d02c51a --- /dev/null +++ b/gui/src/model/project.hpp @@ -0,0 +1,44 @@ +/* + project.hpp - Definition of the Project class + + Copyright (C) Lumiera.org + 2008, Joel Holdsworth + + 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. + +*/ +/** @file project.hpp + ** This file contains the definition of Project, a class which + ** store project data, and wraps proc layer data + */ + +#ifndef PROJECT_HPP +#define PROJECT_HPP + +namespace lumiera { +namespace gui { +namespace model { + +class Project +{ +public: + Project(); +}; + +} // namespace model +} // namespace gui +} // namespace lumiera + +#endif // PROJECT_HPP diff --git a/gui/src/workspace/actions.cpp b/gui/src/workspace/actions.cpp index 2303b1000..8adfcc141 100644 --- a/gui/src/workspace/actions.cpp +++ b/gui/src/workspace/actions.cpp @@ -22,7 +22,7 @@ #include "../gtk-lumiera.hpp" #include "actions.hpp" -#include "main-window.hpp" +#include "workspace-window.hpp" #include "../dialogs/render.hpp" @@ -34,8 +34,8 @@ namespace lumiera { namespace gui { namespace workspace { - Actions::Actions(MainWindow &main_window) : - mainWindow(main_window) + Actions::Actions(WorkspaceWindow &workspace_window) : + workspaceWindow(workspace_window) { actionGroup = ActionGroup::create(); @@ -81,14 +81,14 @@ namespace workspace { void Actions::on_menu_file_render() { - dialogs::Render dialog(mainWindow); + dialogs::Render dialog(workspaceWindow); dialog.run(); } void Actions::on_menu_file_quit() { - mainWindow.hide(); // Closes the main window to stop the Gtk::Main::run(). + workspaceWindow.hide(); // Closes the main window to stop the Gtk::Main::run(). } void @@ -106,7 +106,7 @@ namespace workspace { sizeof(AppAuthors) / sizeof(gchar*), OWNERSHIP_NONE)); - dialog.set_transient_for(mainWindow); + dialog.set_transient_for(workspaceWindow); // Show the about dialog dialog.run(); diff --git a/gui/src/workspace/actions.hpp b/gui/src/workspace/actions.hpp index 2f24517c9..27b744549 100644 --- a/gui/src/workspace/actions.hpp +++ b/gui/src/workspace/actions.hpp @@ -35,7 +35,7 @@ namespace lumiera { namespace gui { namespace workspace { -class MainWindow; +class WorkspaceWindow; /** * A helper class which registers and handles @@ -44,12 +44,12 @@ class MainWindow; class Actions { private: - Actions(MainWindow &main_window); + Actions(WorkspaceWindow &workspace_window); /** * A reference to the MainWindow which owns * this helper */ - MainWindow &mainWindow; + WorkspaceWindow &workspaceWindow; /* ===== Event Handlers ===== */ void on_menu_file_new_project(); @@ -66,7 +66,7 @@ class MainWindow; Glib::RefPtr actionGroup; Glib::RefPtr m_refChoiceOne, m_refChoiceTwo; - friend class MainWindow; + friend class WorkspaceWindow; }; } // namespace workspace diff --git a/gui/src/workspace/main-window.cpp b/gui/src/workspace/workspace-window.cpp similarity index 91% rename from gui/src/workspace/main-window.cpp rename to gui/src/workspace/workspace-window.cpp index b3b728353..5d06b6d18 100644 --- a/gui/src/workspace/main-window.cpp +++ b/gui/src/workspace/workspace-window.cpp @@ -1,5 +1,5 @@ /* - main-window.cpp - Definition of the main workspace window object + workspace-window.cpp - Definition of the main workspace window object Copyright (C) Lumiera.org 2008, Joel Holdsworth @@ -33,26 +33,31 @@ #include #include "gtk-lumiera.hpp" -#include "main-window.hpp" +#include "workspace-window.hpp" using namespace Gtk; +using namespace lumiera::gui::model; namespace lumiera { namespace gui { namespace workspace { - MainWindow::MainWindow() - : actions(*this) + WorkspaceWindow::WorkspaceWindow(Project *source_project) : + project(source_project), + actions(*this) { + layout = NULL; + create_ui(); } - MainWindow::~MainWindow() + WorkspaceWindow::~WorkspaceWindow() { + if(layout != NULL) g_object_unref(layout); } void - MainWindow::create_ui() + WorkspaceWindow::create_ui() { //----- Configure the Window -----// set_title(AppTitle); diff --git a/gui/src/workspace/main-window.hpp b/gui/src/workspace/workspace-window.hpp similarity index 78% rename from gui/src/workspace/main-window.hpp rename to gui/src/workspace/workspace-window.hpp index c544ce5b0..5718ddc25 100644 --- a/gui/src/workspace/main-window.hpp +++ b/gui/src/workspace/workspace-window.hpp @@ -1,5 +1,5 @@ /* - main-window.hpp - Definition of the main workspace window object + workspace-window.hpp - Definition of the main workspace window object Copyright (C) Lumiera.org 2008, Joel Holdsworth @@ -19,15 +19,15 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/** @file mainwindow.hpp +/** @file workspace-window.hpp ** This file contains the definition of the main workspace window ** parent, which is the toplevel parent of the whole workspace. ** ** @see actions.hpp */ -#ifndef MAIN_WINDOW_HPP -#define MAIN_WINDOW_HPP +#ifndef WORKSPACE_WINDOW_HPP +#define WORKSPACE_WINDOW_HPP #include #include @@ -42,22 +42,31 @@ using namespace lumiera::gui::panels; namespace lumiera { namespace gui { + +namespace model { + class Project; +} // model + namespace workspace { /** * The main lumiera workspace window */ - class MainWindow : public Gtk::Window + class WorkspaceWindow : public Gtk::Window { public: - MainWindow(); - virtual ~MainWindow(); + WorkspaceWindow(lumiera::gui::model::Project *source_project); + virtual ~WorkspaceWindow(); - protected: + private: void create_ui(); + /* ===== Model ===== */ + private: + lumiera::gui::model::Project *project; + /* ===== UI ===== */ - protected: + private: Glib::RefPtr uiManager; Gtk::VBox base_container; Gtk::HBox dock_container; @@ -67,13 +76,13 @@ namespace workspace { GdlDockLayout *layout; /* ===== Panels ===== */ - protected: + private: Assets assets; Viewer viewer; Timeline timeline; /* ===== Helpers ===== */ - protected: + private: /** * The instantiation of the actions helper class, which * registers and handles user action events */ @@ -86,4 +95,4 @@ namespace workspace { } // namespace gui } // namespace lumiera -#endif // MAIN_WINDOW_HPP +#endif // WORKSPACE_WINDOW_HPP From b8fd3885f4087582d81bbcbde9efa91f935c02b3 Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Sat, 19 Apr 2008 20:31:27 +0100 Subject: [PATCH 024/110] Added the base of a timeline widget --- gui/src/Makefile.am | 6 +- .../{timeline.cpp => timeline-panel.cpp} | 11 ++- .../{timeline.hpp => timeline-panel.hpp} | 19 +++-- gui/src/widgets/timeline-widget.cpp | 75 +++++++++++++++++++ gui/src/widgets/timeline-widget.hpp | 50 +++++++++++++ gui/src/widgets/video-display.hpp | 2 +- gui/src/workspace/workspace-window.hpp | 4 +- 7 files changed, 148 insertions(+), 19 deletions(-) rename gui/src/panels/{timeline.cpp => timeline-panel.cpp} (80%) rename gui/src/panels/{timeline.hpp => timeline-panel.hpp} (74%) create mode 100644 gui/src/widgets/timeline-widget.cpp create mode 100644 gui/src/widgets/timeline-widget.hpp diff --git a/gui/src/Makefile.am b/gui/src/Makefile.am index 59ca02604..056cad6ce 100644 --- a/gui/src/Makefile.am +++ b/gui/src/Makefile.am @@ -23,14 +23,16 @@ gtk_lumiera_SOURCES = \ dialogs/render.hpp \ panels/panel.cpp \ panels/panel.hpp \ - panels/timeline.cpp \ - panels/timeline.hpp \ + panels/timeline-panel.cpp \ + panels/timeline-panel.hpp \ panels/viewer.cpp \ panels/viewer.hpp \ panels/assets.cpp \ panels/assets.hpp \ widgets/video-display.cpp \ widgets/video-display.hpp \ + widgets/timeline-widget.cpp \ + widgets/timeline-widget.hpp \ model/project.cpp \ model/project.hpp diff --git a/gui/src/panels/timeline.cpp b/gui/src/panels/timeline-panel.cpp similarity index 80% rename from gui/src/panels/timeline.cpp rename to gui/src/panels/timeline-panel.cpp index 1e5086fd7..7d1de24ea 100644 --- a/gui/src/panels/timeline.cpp +++ b/gui/src/panels/timeline-panel.cpp @@ -1,5 +1,5 @@ /* - timeline.cpp - Implementation of the timeline panel + timeline-panel.cpp - Implementation of the timeline panel Copyright (C) Lumiera.org 2008, Joel Holdsworth @@ -20,17 +20,16 @@ * *****************************************************/ -#include "timeline.hpp" +#include "timeline-panel.hpp" namespace lumiera { namespace gui { namespace panels { -Timeline::Timeline() : - Panel("timeline", "Timeline"), - placeholder("Placeholder label. Is Timeline the correct title for this panel?") +TimelinePanel::TimelinePanel() : + Panel("timeline", "Timeline") { - pack_start(placeholder); + pack_start(timeline_widget); } } // namespace panels diff --git a/gui/src/panels/timeline.hpp b/gui/src/panels/timeline-panel.hpp similarity index 74% rename from gui/src/panels/timeline.hpp rename to gui/src/panels/timeline-panel.hpp index b219b3f55..bc1fbff08 100644 --- a/gui/src/panels/timeline.hpp +++ b/gui/src/panels/timeline-panel.hpp @@ -1,5 +1,5 @@ /* - timeline.hpp - Definition of the timeline panel + timeline-panel.hpp - Definition of the timeline panel Copyright (C) Lumiera.org 2008, Joel Holdsworth @@ -19,30 +19,33 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/** @file timeline.hpp +/** @file timeline-panel.hpp ** This file contains the definition of the timeline panel */ -#ifndef TIMELINE_HPP -#define TIMELINE_HPP +#ifndef TIMELINE_PANEL_HPP +#define TIMELINE_PANEL_HPP #include "panel.hpp" +#include "../widgets/timeline-widget.hpp" + +using namespace lumiera::gui::widgets; namespace lumiera { namespace gui { namespace panels { - class Timeline : public Panel + class TimelinePanel : public Panel { public: - Timeline(); + TimelinePanel(); protected: - Gtk::Label placeholder; + TimelineWidget timeline_widget; }; } // namespace panels } // namespace gui } // namespace lumiera -#endif // TIMELINE_H +#endif // TIMELINE_PANEL_H diff --git a/gui/src/widgets/timeline-widget.cpp b/gui/src/widgets/timeline-widget.cpp new file mode 100644 index 000000000..10eaa3fb0 --- /dev/null +++ b/gui/src/widgets/timeline-widget.cpp @@ -0,0 +1,75 @@ +/* + timeline.cpp - Implementation of the timeline widget + + Copyright (C) Lumiera.org + 2008, Joel Holdsworth + + 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 +#include +#include + +#include "timeline-widget.hpp" + +namespace lumiera { +namespace gui { +namespace widgets { + +TimelineWidget::TimelineWidget() + { + set_flags(Gtk::NO_WINDOW); + } + +void +TimelineWidget::on_realize() + { + //Call base class: + Gtk::Widget::on_realize(); + + } + +bool +TimelineWidget::on_expose_event(GdkEventExpose* event) + { + // This is where we draw on the window + Glib::RefPtr window = get_window(); + if(window) + { + /*Cairo::RefPtr cr = window->create_cairo_context(); + if(event) + { + // clip to the area that needs to be re-exposed so we don't draw any + // more than we need to. + cr->rectangle(event->area.x, event->area.y, + event->area.width, event->area.height); + cr->clip(); + } + + // Paint the background + cr->set_source_rgb(0.0, 0.0, 0.0); + cr->paint();*/ + } + return true; + } + + + +} // namespace widgets +} // namespace gui +} // namespace lumiera + diff --git a/gui/src/widgets/timeline-widget.hpp b/gui/src/widgets/timeline-widget.hpp new file mode 100644 index 000000000..a080d34b2 --- /dev/null +++ b/gui/src/widgets/timeline-widget.hpp @@ -0,0 +1,50 @@ +/* + timeline.hpp - Declaration of the timeline widget + + Copyright (C) Lumiera.org + 2008, Joel Holdsworth + + 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. + +*/ +/** @file timeline.hpp + ** This file contains the definition of timeline widget + */ + +#ifndef TIMELINE_WIDGET_HPP +#define TIMELINE_WIDGET_HPP + +#include + +namespace lumiera { +namespace gui { +namespace widgets { + + class TimelineWidget : public Gtk::Widget + { + public: + TimelineWidget(); + + /* ===== Overrides ===== */ + protected: + virtual void on_realize(); + virtual bool on_expose_event(GdkEventExpose* event); + }; + +} // namespace widgets +} // namespace gui +} // namespace lumiera + +#endif // TIMELINE_WIDGET_HPP diff --git a/gui/src/widgets/video-display.hpp b/gui/src/widgets/video-display.hpp index 34fbce81c..6fdd73958 100644 --- a/gui/src/widgets/video-display.hpp +++ b/gui/src/widgets/video-display.hpp @@ -47,4 +47,4 @@ namespace widgets { } // namespace gui } // namespace lumiera -#endif // VIDEO_DISPLAY_H +#endif // VIDEO_DISPLAY_HPP diff --git a/gui/src/workspace/workspace-window.hpp b/gui/src/workspace/workspace-window.hpp index 5718ddc25..a111cafeb 100644 --- a/gui/src/workspace/workspace-window.hpp +++ b/gui/src/workspace/workspace-window.hpp @@ -36,7 +36,7 @@ #include "../panels/assets.hpp" #include "../panels/viewer.hpp" -#include "../panels/timeline.hpp" +#include "../panels/timeline-panel.hpp" using namespace lumiera::gui::panels; @@ -79,7 +79,7 @@ namespace workspace { private: Assets assets; Viewer viewer; - Timeline timeline; + TimelinePanel timeline; /* ===== Helpers ===== */ private: From b020607065946e15eadd48057f2a12af536e0011 Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Sat, 19 Apr 2008 20:47:53 +0100 Subject: [PATCH 025/110] Renamed some classes to be less ambiguous between namespaces --- gui/src/Makefile.am | 12 ++++++------ .../panels/{assets.cpp => assets-panel.cpp} | 6 +++--- .../panels/{assets.hpp => assets-panel.hpp} | 14 +++++++------- .../panels/{viewer.cpp => viewer-panel.cpp} | 6 +++--- .../panels/{viewer.hpp => viewer-panel.hpp} | 18 +++++++++--------- ...eo-display.cpp => video-display-widget.cpp} | 12 +++++------- ...eo-display.hpp => video-display-widget.hpp} | 14 +++++++------- gui/src/workspace/workspace-window.cpp | 10 +++++----- gui/src/workspace/workspace-window.hpp | 10 +++++----- 9 files changed, 50 insertions(+), 52 deletions(-) rename gui/src/panels/{assets.cpp => assets-panel.cpp} (91%) rename gui/src/panels/{assets.hpp => assets-panel.hpp} (82%) rename gui/src/panels/{viewer.cpp => viewer-panel.cpp} (93%) rename gui/src/panels/{viewer.hpp => viewer-panel.hpp} (81%) rename gui/src/widgets/{video-display.cpp => video-display-widget.cpp} (88%) rename gui/src/widgets/{video-display.hpp => video-display-widget.hpp} (80%) diff --git a/gui/src/Makefile.am b/gui/src/Makefile.am index 056cad6ce..d5a380fed 100644 --- a/gui/src/Makefile.am +++ b/gui/src/Makefile.am @@ -25,12 +25,12 @@ gtk_lumiera_SOURCES = \ panels/panel.hpp \ panels/timeline-panel.cpp \ panels/timeline-panel.hpp \ - panels/viewer.cpp \ - panels/viewer.hpp \ - panels/assets.cpp \ - panels/assets.hpp \ - widgets/video-display.cpp \ - widgets/video-display.hpp \ + panels/viewer-panel.cpp \ + panels/viewer-panel.hpp \ + panels/assets-panel.cpp \ + panels/asset-panels.hpp \ + widgets/video-display-widget.cpp \ + widgets/video-display-widget.hpp \ widgets/timeline-widget.cpp \ widgets/timeline-widget.hpp \ model/project.cpp \ diff --git a/gui/src/panels/assets.cpp b/gui/src/panels/assets-panel.cpp similarity index 91% rename from gui/src/panels/assets.cpp rename to gui/src/panels/assets-panel.cpp index daaa0f363..57a7edf6f 100644 --- a/gui/src/panels/assets.cpp +++ b/gui/src/panels/assets-panel.cpp @@ -1,5 +1,5 @@ /* - assets.cpp - Implementation of the assets panel + assets-panel.cpp - Implementation of the assets panel Copyright (C) Lumiera.org 2008, Joel Holdsworth @@ -20,13 +20,13 @@ * *****************************************************/ -#include "assets.hpp" +#include "assets-panel.hpp" namespace lumiera { namespace gui { namespace panels { -Assets::Assets() : +AssetsPanel::AssetsPanel() : Panel("assets", "Assets"), placeholder("Placeholder label. Is this supposed to be titled assets\nas in the proc layer? or resources\nas in cinelerra?") { diff --git a/gui/src/panels/assets.hpp b/gui/src/panels/assets-panel.hpp similarity index 82% rename from gui/src/panels/assets.hpp rename to gui/src/panels/assets-panel.hpp index f6d1d5544..899c15db4 100644 --- a/gui/src/panels/assets.hpp +++ b/gui/src/panels/assets-panel.hpp @@ -1,5 +1,5 @@ /* - assets.hpp - Definition of the assets panel + assets-panel.hpp - Definition of the assets panel Copyright (C) Lumiera.org 2008, Joel Holdsworth @@ -19,12 +19,12 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/** @file timeline.hpp +/** @file assets-panel.hpp ** This file contains the definition of the assets panel */ -#ifndef ASSETS_HPP -#define ASSETS_HPP +#ifndef ASSETS_PANEL_HPP +#define ASSETS_PANEL_HPP #include "panel.hpp" @@ -32,10 +32,10 @@ namespace lumiera { namespace gui { namespace panels { - class Assets : public Panel + class AssetsPanel : public Panel { public: - Assets(); + AssetsPanel(); protected: Gtk::Label placeholder; @@ -45,4 +45,4 @@ namespace panels { } // namespace gui } // namespace lumiera -#endif // ASSETS_HPP +#endif // ASSETS_PANEL_HPP diff --git a/gui/src/panels/viewer.cpp b/gui/src/panels/viewer-panel.cpp similarity index 93% rename from gui/src/panels/viewer.cpp rename to gui/src/panels/viewer-panel.cpp index 0c64f3d68..ea1bfeffd 100644 --- a/gui/src/panels/viewer.cpp +++ b/gui/src/panels/viewer-panel.cpp @@ -1,5 +1,5 @@ /* - viewer.cpp - Implementation of the viewer panel + viewer-panel.cpp - Implementation of the viewer panel Copyright (C) Lumiera.org 2008, Joel Holdsworth @@ -20,7 +20,7 @@ * *****************************************************/ -#include "viewer.hpp" +#include "viewer-panel.hpp" using namespace lumiera::gui::widgets; using namespace Gtk; @@ -29,7 +29,7 @@ namespace lumiera { namespace gui { namespace panels { -Viewer::Viewer() : +ViewerPanel::ViewerPanel() : Panel("viewer", "Viewer"), previousButton(Stock::MEDIA_PREVIOUS), rewindButton(Stock::MEDIA_REWIND), diff --git a/gui/src/panels/viewer.hpp b/gui/src/panels/viewer-panel.hpp similarity index 81% rename from gui/src/panels/viewer.hpp rename to gui/src/panels/viewer-panel.hpp index fb6d77760..9f92b4f63 100644 --- a/gui/src/panels/viewer.hpp +++ b/gui/src/panels/viewer-panel.hpp @@ -1,5 +1,5 @@ /* - viewer.hpp - Definition of the viewer panel + viewer-panel.hpp - Definition of the viewer panel Copyright (C) Lumiera.org 2008, Joel Holdsworth @@ -19,17 +19,17 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/** @file viewer.hpp +/** @file viewer-panel.hpp ** This file contains the definition of the viewer panel */ -#ifndef VIEWER_HPP -#define VIEWER_HPP +#ifndef VIEWER_PANEL_HPP +#define VIEWER_PANEL_HPP #include #include "panel.hpp" -#include "../widgets/video-display.hpp" +#include "../widgets/video-display-widget.hpp" using namespace lumiera::gui::widgets; using namespace Gtk; @@ -38,10 +38,10 @@ namespace lumiera { namespace gui { namespace panels { - class Viewer : public Panel + class ViewerPanel : public Panel { public: - Viewer(); + ViewerPanel(); protected: @@ -51,7 +51,7 @@ namespace panels { ToolButton forwardButton; ToolButton nextButton; - VideoDisplay display; + VideoDisplayWidget display; Toolbar toolBar; }; @@ -59,4 +59,4 @@ namespace panels { } // namespace gui } // namespace lumiera -#endif // VIEWER_HPP +#endif // VIEWER_PANEL_HPP diff --git a/gui/src/widgets/video-display.cpp b/gui/src/widgets/video-display-widget.cpp similarity index 88% rename from gui/src/widgets/video-display.cpp rename to gui/src/widgets/video-display-widget.cpp index 29d95268d..16b089c5b 100644 --- a/gui/src/widgets/video-display.cpp +++ b/gui/src/widgets/video-display-widget.cpp @@ -1,5 +1,5 @@ /* - video-display.cpp - Implementation of the video viewer widget + video-display-widget.cpp - Implementation of the video viewer widget Copyright (C) Lumiera.org 2008, Joel Holdsworth @@ -24,19 +24,19 @@ #include #include -#include "video-display.hpp" +#include "video-display-widget.hpp" namespace lumiera { namespace gui { namespace widgets { -VideoDisplay::VideoDisplay() +VideoDisplayWidget::VideoDisplayWidget() { set_flags(Gtk::NO_WINDOW); } void -VideoDisplay::on_realize() +VideoDisplayWidget::on_realize() { //Call base class: Gtk::Widget::on_realize(); @@ -44,7 +44,7 @@ VideoDisplay::on_realize() } bool -VideoDisplay::on_expose_event(GdkEventExpose* event) +VideoDisplayWidget::on_expose_event(GdkEventExpose* event) { // This is where we draw on the window Glib::RefPtr window = get_window(); @@ -67,8 +67,6 @@ VideoDisplay::on_expose_event(GdkEventExpose* event) return true; } - - } // namespace widgets } // namespace gui } // namespace lumiera diff --git a/gui/src/widgets/video-display.hpp b/gui/src/widgets/video-display-widget.hpp similarity index 80% rename from gui/src/widgets/video-display.hpp rename to gui/src/widgets/video-display-widget.hpp index 6fdd73958..d082e8a2f 100644 --- a/gui/src/widgets/video-display.hpp +++ b/gui/src/widgets/video-display-widget.hpp @@ -1,5 +1,5 @@ /* - video-display.hpp - Declaration of the video viewer widget + video-display-widget.hpp - Declaration of the video viewer widget Copyright (C) Lumiera.org 2008, Joel Holdsworth @@ -19,12 +19,12 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/** @file viewer.hpp +/** @file viewer-display-widget.hpp ** This file contains the definition of video viewer widget */ -#ifndef VIDEO_DISPLAY_HPP -#define VIDEO_DISPLAY_HPP +#ifndef VIDEO_DISPLAY_WIDGET_HPP +#define VIDEO_DISPLAY_WIDGET_HPP #include @@ -32,10 +32,10 @@ namespace lumiera { namespace gui { namespace widgets { - class VideoDisplay : public Gtk::Widget + class VideoDisplayWidget : public Gtk::Widget { public: - VideoDisplay(); + VideoDisplayWidget(); /* ===== Overrides ===== */ protected: @@ -47,4 +47,4 @@ namespace widgets { } // namespace gui } // namespace lumiera -#endif // VIDEO_DISPLAY_HPP +#endif // VIDEO_DISPLAY_WIDGET_HPP diff --git a/gui/src/workspace/workspace-window.cpp b/gui/src/workspace/workspace-window.cpp index 5d06b6d18..d78eb5b5c 100644 --- a/gui/src/workspace/workspace-window.cpp +++ b/gui/src/workspace/workspace-window.cpp @@ -130,14 +130,14 @@ namespace workspace { dock_container.pack_end(*dock, PACK_EXPAND_WIDGET); base_container.pack_start(dock_container, PACK_EXPAND_WIDGET); - gdl_dock_add_item ((GdlDock*)dock->gobj(), assets.get_dock_item(), GDL_DOCK_LEFT); - gdl_dock_add_item ((GdlDock*)dock->gobj(), viewer.get_dock_item(), GDL_DOCK_RIGHT); - gdl_dock_add_item ((GdlDock*)dock->gobj(), timeline.get_dock_item(), GDL_DOCK_BOTTOM); + gdl_dock_add_item ((GdlDock*)dock->gobj(), assets_panel.get_dock_item(), GDL_DOCK_LEFT); + gdl_dock_add_item ((GdlDock*)dock->gobj(), viewer_panel.get_dock_item(), GDL_DOCK_RIGHT); + gdl_dock_add_item ((GdlDock*)dock->gobj(), timeline_panel.get_dock_item(), GDL_DOCK_BOTTOM); // Manually dock and move around some of the items - gdl_dock_item_dock_to (timeline.get_dock_item(), assets.get_dock_item(), + gdl_dock_item_dock_to (timeline_panel.get_dock_item(), assets_panel.get_dock_item(), GDL_DOCK_BOTTOM, -1); - gdl_dock_item_dock_to (viewer.get_dock_item(), assets.get_dock_item(), + gdl_dock_item_dock_to (viewer_panel.get_dock_item(), assets_panel.get_dock_item(), GDL_DOCK_RIGHT, -1); show_all_children(); diff --git a/gui/src/workspace/workspace-window.hpp b/gui/src/workspace/workspace-window.hpp index a111cafeb..70d1a04e4 100644 --- a/gui/src/workspace/workspace-window.hpp +++ b/gui/src/workspace/workspace-window.hpp @@ -34,8 +34,8 @@ #include "actions.hpp" -#include "../panels/assets.hpp" -#include "../panels/viewer.hpp" +#include "../panels/assets-panel.hpp" +#include "../panels/viewer-panel.hpp" #include "../panels/timeline-panel.hpp" using namespace lumiera::gui::panels; @@ -77,9 +77,9 @@ namespace workspace { /* ===== Panels ===== */ private: - Assets assets; - Viewer viewer; - TimelinePanel timeline; + AssetsPanel assets_panel; + ViewerPanel viewer_panel; + TimelinePanel timeline_panel; /* ===== Helpers ===== */ private: From 786ff5743f17fe84684e4cdbbdea346929b99d03 Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Sat, 19 Apr 2008 23:16:27 +0100 Subject: [PATCH 026/110] Added basic theme support --- gui/src/Makefile.am | 2 + gui/src/dialogs/render.cpp | 2 +- gui/src/gtk-lumiera.cpp | 6 +- gui/src/gtk-lumiera.hpp | 6 +- gui/src/lumiera_ui.rc | 1496 ++++++++++++++++++++++++++++++++++++ gui/src/window-manager.cpp | 48 ++ gui/src/window-manager.hpp | 51 ++ 7 files changed, 1606 insertions(+), 5 deletions(-) create mode 100644 gui/src/lumiera_ui.rc create mode 100644 gui/src/window-manager.cpp create mode 100644 gui/src/window-manager.hpp diff --git a/gui/src/Makefile.am b/gui/src/Makefile.am index d5a380fed..ac159ea65 100644 --- a/gui/src/Makefile.am +++ b/gui/src/Makefile.am @@ -15,6 +15,8 @@ bin_PROGRAMS = gtk-lumiera gtk_lumiera_SOURCES = \ gtk-lumiera.cpp \ gtk-lumiera.hpp \ + window-manager.cpp \ + window-manager.hpp \ workspace/actions.cpp \ workspace/actions.hpp \ workspace/workspace-window.cpp \ diff --git a/gui/src/dialogs/render.cpp b/gui/src/dialogs/render.cpp index f785ed6a4..6fadd82fb 100644 --- a/gui/src/dialogs/render.cpp +++ b/gui/src/dialogs/render.cpp @@ -88,7 +88,7 @@ namespace dialogs { // Add response buttons the the dialog: dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); - dialog.add_button(/*Gtk::Stock::SAVE*/"Save", Gtk::RESPONSE_OK); + dialog.add_button(Gtk::Stock::SAVE, Gtk::RESPONSE_OK); int result = dialog.run(); g_message("%d", result); diff --git a/gui/src/gtk-lumiera.cpp b/gui/src/gtk-lumiera.cpp index a7951b3a0..7178c4170 100644 --- a/gui/src/gtk-lumiera.cpp +++ b/gui/src/gtk-lumiera.cpp @@ -21,13 +21,13 @@ * *****************************************************/ #include -#include #ifdef ENABLE_NLS # include #endif #include "gtk-lumiera.hpp" +#include "window-manager.hpp" #include "workspace/workspace-window.hpp" #include "model/project.hpp" @@ -57,6 +57,10 @@ namespace gui { Glib::set_application_name(AppTitle); Project project; + WindowManager window_manager; + + window_manager.set_theme("lumiera_ui.rc"); + WorkspaceWindow main_window(&project); kit.run(main_window); diff --git a/gui/src/gtk-lumiera.hpp b/gui/src/gtk-lumiera.hpp index 6532d2b42..a3586e0d1 100644 --- a/gui/src/gtk-lumiera.hpp +++ b/gui/src/gtk-lumiera.hpp @@ -22,11 +22,11 @@ /** @file gtk-lumiera.hpp ** This file contains application wide global definitions ** user actions. - ** @see main.cpp + ** @see gtk-lumiera.cpp */ #ifndef GTK_LUMIERA_HPP -#define GTK_LUMIERA_HPO +#define GTK_LUMIERA_HPP #include @@ -92,6 +92,6 @@ namespace gui { } // namespace gui } // namespace lumiera -#endif +#endif // GTK_LUMIERA_HPP diff --git a/gui/src/lumiera_ui.rc b/gui/src/lumiera_ui.rc new file mode 100644 index 000000000..d87322014 --- /dev/null +++ b/gui/src/lumiera_ui.rc @@ -0,0 +1,1496 @@ +# +# This is the GTK style file for Ardour +# +# + +style "very_small_text" +{ + font_name = "sans 7" +} + +style "small_text" +{ + font_name = "sans 8" +} + +style "small_bold_text" +{ + font_name = "sans bold 8" +} + +style "medium_bold_text" +{ + font_name = "sans bold 8" +} + +style "medium_text" +{ + font_name = "sans 8" +} + +style "red_medium_text" = "medium_text" +{ + fg[NORMAL] = { 1.0, 0, 0 } + fg[ACTIVE] = { 1.0, 0, 0 } + fg[SELECTED] = { 1.0, 0, 0 } +} + + +style "large_text" +{ + font_name = "sans 18" +} + +style "larger_bold_text" +{ + font_name = "sans bold 14" +} + +style "plugin_name_text" +{ + font_name = "sans bold 25" + fg[NORMAL] = { 0.80, 0.80, 0.80 } +} + +style "plugin_maker_text" +{ + font_name = "sans bold 14" + fg[NORMAL] = { 0.80, 0.80, 0.80 } +} + +style "automation_track_name" +{ + font_name = "sans italic 8" +} + +style "first_action_message" +{ + font_name = "sans medium 34" +} + +style "verbose_canvas_cursor" +{ + font_name = "sans bold 24" +} + +style "marker_text" +{ + font_name = "sans 8" +} + +style "time_axis_view_item_name" +{ + font_name = "sans 9" +} + +style "default_base" = "medium_text" +{ + GtkWidget::cursor_color = {1.0, 1.0, 1.0 } + GtkButton::default_border = { 0, 0, 0, 0 } + GtkButton::default_outside_border = { 0, 0, 0, 0 } + GtkTreeView::vertical-padding = 0 + GtkTreeView::horizontal-padding = 0 + GtkTreeView::even-row-color = { 0, 0, 0 } + GtkTreeView::odd-row-color = { 0, 0, 0 } + + fg[NORMAL] = { 0.80, 0.80, 0.80 } + fg[ACTIVE] = { 0.80, 0.80, 0.80 } + fg[PRELIGHT] = { 1.0, 1.0, 1.0 } + fg[INSENSITIVE] = { 0.80, 0.80, 0.80 } + fg[SELECTED] = { 0.80, 0.80, 0.80 } + + bg[NORMAL] = { 0.35, 0.35, 0.40 } + bg[ACTIVE] = { 0.35, 0.35, 0.40 } + bg[PRELIGHT] = "#565690" + bg[INSENSITIVE] = { 0.10, 0.10, 0.10 } + bg[SELECTED] = { 0, 0.40, 0.60 } + + text[NORMAL] = { 0.80, 0.80, 0.80 } + text[ACTIVE] = { 0.80, 0.80, 0.80 } + text[PRELIGHT] = { 0.80, 0.80, 0.80 } + text[INSENSITIVE] = { 0.80, 0.80, 0.80} + text[SELECTED] = { 1.0, 1.0, 1.0 } + + base[ACTIVE] = "#272a2f" + base[NORMAL] = "#1a1e20" + base[PRELIGHT] = { 0.20, 0.20, 0.20 } + base[INSENSITIVE] = "#4c5159" + base[SELECTED] = { 0.25, 0.25, 0.25 } + + engine "clearlooks" + { + menubarstyle = 2 # 0 = flat, 1 = sunken, 2 = flat gradient + menuitemstyle = 1 # 0 = flat, 1 = 3d-ish (gradient), 2 = 3d-ish (button) + listviewitemstyle = 1 # 0 = flat, 1 = 3d-ish (gradient) + progressbarstyle = 1 # 0 = candy bar, 1 = fancy candy bar, 2 = flat + } +} + +style "base_frame" +{ + fg[NORMAL] = { 0.80, 0.80, 0.80 } + bg[NORMAL] = { 0.35, 0.35, 0.40 } +} + +style "transport_base" = "medium_bold_text" +{ + bg[NORMAL] = { 0.10, 0.10, 0.10 } + bg[ACTIVE] = { 0, 0, 0 } + bg[PRELIGHT] = { 0, 0, 0 } + bg[INSENSITIVE] = { 0, 0, 0 } + bg[SELECTED] = { 0, 0, 0 } +} + +style "black_mackie_menu_bar" +{ + font_name = "sans bold 9" + fg[NORMAL] = { 1.0, 1.0, 1.0 } + bg[NORMAL] = { 0, 0, 0 } +} + +style "default_buttons_menus" +{ + font_name = "sans 8" + fg[ACTIVE] = { 1.0, 1.0, 1.0 } + + bg[NORMAL] = { 0.30, 0.30, 0.35 } + bg[ACTIVE] = "#565690" + bg[PRELIGHT] = { 0.15, 0.15, 0.20 } + bg[INSENSITIVE] = { 0.15, 0.15, 0.20 } + bg[SELECTED] = { 0.15, 0.15, 0.20 } +} + +style "very_small_button" = "default_buttons_menus" +{ + font_name = "sans 7" + ythickness = 0 + xthickness = 0 +} + +style "small_button" = "default_buttons_menus" +{ +} + +style "very_small_red_active_and_selected_button" = "very_small_button" +{ + bg[ACTIVE] = { 1.0, 0, 0} + bg[SELECTED] = { 1.0, 0, 0} +} + +style "small_red_active_and_selected_button" = "small_button" +{ + fg[ACTIVE] = { 0, 0, 0 } + bg[ACTIVE] = { 1.0, 0, 0} + bg[SELECTED] = { 1.0, 0, 0} +} + +style "gain_fader" +{ + bg[NORMAL] = { 0.269, 0.269, 0.300} + bg[ACTIVE] = { 0.152, 0.152, 0.168 } +} + + +style "track_rec_enable_button" = "small_button" +{ +} + +style "track_rec_enable_button_active" = "small_button" +{ + fg[SELECTED] = { 0.0, 0.0, 0.0 } + fg[ACTIVE] = { 0.0, 0.0, 0.0 } + fg[PRELIGHT] = { 0.0, 0.0, 0.0 } + fg[NORMAL] = { 0.0, 0.0, 0.0 } + + bg[NORMAL] = { 1.0, 0.0, 0.0 } + bg[ACTIVE] = { 1.0, 0.0, 0.0 } + bg[SELECTED] = { 1.0, 0.0, 0.0 } + bg[PRELIGHT] = { 1.0, 0.0, 0.0 } +} + +style "track_rec_enable_button_alternate" = "small_button" +{ + fg[SELECTED] = { 0.0, 0.0, 0.0 } + fg[ACTIVE] = { 0.0, 0.0, 0.0 } + fg[PRELIGHT] = { 0.0, 0.0, 0.0 } + fg[NORMAL] = { 0.0, 0.0, 0.0 } + + bg[NORMAL] = { 0.91, 0.68, 0.68} + bg[ACTIVE] = { 0.91, 0.68, 0.68} + bg[SELECTED] = { 0.91, 0.68, 0.68} + bg[PRELIGHT] = { 0.91, 0.68, 0.68} +} + +style "mixer_track_rec_enable_button" = "track_rec_enable_button" +{ + font_name = "sans 7" + xthickness = 0 + ythickness = 0 +} + +style "mixer_track_rec_enable_button_alternate" = "track_rec_enable_button_alternate" +{ + font_name = "sans 7" + xthickness = 0 + ythickness = 0 +} + +style "mixer_track_rec_enable_button_active" = "track_rec_enable_button_active" +{ + font_name = "sans 7" + xthickness = 0 + ythickness = 0 +} + +style "solo_button" = "small_button" +{ +} + +style "solo_button_alternate" = "small_button" +{ + bg[NORMAL] = { 0.19, 0.97, 0.69 } # solo-safe + bg[ACTIVE] = { 0.19, 0.97, 0.69 } # solo-safe + bg[SELECTED] = { 0.19, 0.97, 0.69 } # solo-safe + bg[PRELIGHT] = { 0.19, 0.97, 0.69 } # solo-safe + + fg[ACTIVE] = { 0, 0, 0 } + fg[SELECTED] = { 0, 0, 0 } + fg[NORMAL] = { 0, 0, 0 } + fg[PRELIGHT] = { 0, 0, 0 } +} + + +style "solo_button_active" = "small_button" +{ + bg[NORMAL] = { 0.66, 0.97, 0.19 } # solo + bg[ACTIVE] = { 0.66, 0.97, 0.19 } # solo + bg[SELECTED] = { 0.66, 0.97, 0.19 } # solo + bg[PRELIGHT] = { 0.66, 0.97, 0.19 } # solo + + fg[ACTIVE] = { 0, 0, 0 } + fg[SELECTED] = { 0, 0, 0 } + fg[NORMAL] = { 0, 0, 0 } + fg[PRELIGHT] = { 0, 0, 0 } +} + +style "mixer_solo_button" = "solo_button" +{ + font_name = "sans 7" + xthickness = 0 + ythickness = 0 +} + +style "mixer_solo_button_alternate" = "solo_button_alternate" +{ + font_name = "sans 7" + xthickness = 0 + ythickness = 0 +} +style "mixer_solo_button_active" = "solo_button_active" +{ + font_name = "sans 7" + xthickness = 0 + ythickness = 0 +} + + +style "mute_button" = "small_button" +{ +} + +style "mute_button_alternate" = "small_button" +{ + bg[ACTIVE] = { 1.0, 0.98, 0.53 } + bg[NORMAL] = { 1.0, 0.98, 0.53 } + bg[SELECTED] = { 1.0, 0.98, 0.53 } + bg[PRELIGHT] = { 1.0, 0.98, 0.53 } + + fg[SELECTED] = { 0, 0, 0 } + fg[ACTIVE] = { 0, 0, 0 } + fg[NORMAL] = { 0, 0, 0 } + fg[PRELIGHT] = { 0, 0, 0 } +} + +style "mute_button_active" = "small_button" +{ + bg[NORMAL] = { 0.90, 0.89, 0.73 } + bg[ACTIVE] = { 0.90, 0.89, 0.73 } + bg[PRELIGHT] = { 0.90, 0.89, 0.73 } + bg[SELECTED] = { 0.90, 0.89, 0.73 } + + fg[SELECTED] = { 0, 0, 0 } + fg[ACTIVE] = { 0, 0, 0 } + fg[NORMAL] = { 0, 0, 0 } + fg[PRELIGHT] = { 0, 0, 0 } +} + +style "mixer_mute_button" = "mute_button" +{ + font_name = "sans 7" + xthickness = 0 + ythickness = 0 +} + +style "mixer_mute_button_alternate" = "mute_button_alternate" +{ + font_name = "sans 7" + xthickness = 0 + ythickness = 0 +} + +style "mixer_mute_button_active" = "mute_button_active" +{ + font_name = "sans 7" + xthickness = 0 + ythickness = 0 +} + +style "multiline_combo" = "small_button" +{ + font_name = "sans 8" + xthickness = 0 + ythickness = 0 +} + +style "mixer_mute_button" = "mute_button" +{ + font_name = "sans 7" + xthickness = 0 + ythickness = 0 +} + +style "track_loop_button" = "small_button" +{ + bg[ACTIVE] = { 1.0, 0.98, 0.53 } + bg[PRELIGHT] = { 1.0, 0.98, 0.53 } + +} + +style "mixer_red_active_button" = "very_small_button" +{ + fg[ACTIVE] = { 0, 1.0, 1.0 } + bg[ACTIVE] = { 0.7, 0, 0 } + + base[INSENSITIVE] = { 0.16, 0.16, 0.21 } + bg[INSENSITIVE] = { 0.16, 0.16, 0.21 } +} + +style "time_button" = "default_buttons_menus" +{ + font_name = "sans 8" +} + +style "transport_button" +{ +} + +style "transport_button_active" +{ + bg[NORMAL] = { 0.50, 1.0, 0.50 } + bg[ACTIVE] = { 0.50, 1.0, 0.50 } + bg[SELECTED] = { 0.50, 1.0, 0.50 } + bg[PRELIGHT] = { 0.50, 1.0, 0.50 } + + fg[NORMAL] = { 0, 0, 0 } + fg[PRELIGHT] = { 0, 0, 0 } + fg[SELECTED] = { 0, 0, 0 } + fg[ACTIVE] = { 0, 0, 0 } +} + +style "transport_rec_button" +{ +} + +style "transport_rec_button_active" +{ + bg[ACTIVE] = { 1.0, 0, 0 } + bg[NORMAL] = { 1.0, 0, 0 } + bg[SELECTED] = { 1.0, 0, 0 } + bg[PRELIGHT] = { 1.0, 0, 0 } +} + +style "transport_rec_button_alternate" +{ + bg[PRELIGHT] = { 0.91, 0.68, 0.68 } + bg[NORMAL] = { 0.91, 0.68, 0.68 } + bg[SELECTED] = { 0.91, 0.68, 0.68 } + bg[ACTIVE] = { 0.91, 0.68, 0.68 } +} + +style "shuttle_control" = "very_small_text" +{ + fg[NORMAL] = { 0.85, 0.92, 0.98 } + fg[ACTIVE] = { 0.85, 0.92, 0.98 } + fg[PRELIGHT] = { 0.85, 0.92, 0.98 } + fg[SELECTED] = { 0.85, 0.92, 0.98 } + fg[INSENSITIVE] = { 0.85, 0.92, 0.98 } + + bg[NORMAL] = { 0.26, 0.26, 0.31 } + bg[PRELIGHT] = { 0.26, 0.26, 0.31 } + bg[INSENSITIVE] = { 0.26, 0.26, 0.31 } + bg[ACTIVE] = { 0.70, 0.70, 0.70 } + bg[SELECTED] = { 1.0, 0.04, 0.04 } +} + +style "ardour_adjusters" = "default_buttons_menus" +{ + bg[NORMAL] = { 0.60, 0.60, 0.60 } + bg[PRELIGHT] = { 0.80, 0.80, 0.80 } + bg[ACTIVE] = { 0.06, 0.06, 0.06 } +} + +style "editor_hscrollbar" = "ardour_adjusters" +{ + # + # special case: we want this scrollbar to be as tall as the + # zoom focus selector combobox. scrollbars don't expand to + # fill the space available to them, so we have to explicitly + # make it bigger. + # + GtkRange::slider_width = 27 + GtkScrollbar::slider_width = 27 +} + +style "ardour_progressbars" = "default_buttons_menus" +{ + bg[NORMAL] = { 0, 0, 0 } + bg[PRELIGHT] = { 0.00, 0.36, 0.40 } +} + +style "options_window" = "default_base" +{ + font_name = "sans 8" + fg[PRELIGHT] = { 0.80, 0.80, 0.80 } +} + +style "option_entry" = "default_base" +{ + fg[NORMAL] = { 1.0, 1.0, 1.0 } + fg[ACTIVE] = { 1.0, 1.0, 1.0 } + fg[INSENSITIVE] = { 0.80, 0.80, 0.80 } + + base[INSENSITIVE] = { 0.07, 0.07, 0.12 } + + bg[NORMAL] = { 0.35, 0.35, 0.40 } + bg[ACTIVE] = { 0.35, 0.35, 0.40 } +} + +style "red_when_active" = "medium_text" +{ + fg[NORMAL] = { 0.80, 0.80, 0.80 } + bg[NORMAL] = { 0.26, 0.26, 0.31 } + + fg[ACTIVE] = { 0.80, 0.80, 0.80 } + bg[ACTIVE] = { 1.0, 0, 0} +} + +style "xrun_warn" +{ + font_name = "sans bold 18" + + fg[NORMAL] = { 1.0, 1.0, 1.0 } + fg[ACTIVE] = { 1.0, 1.0, 1.0 } + text[NORMAL] = { 1.0, 1.0, 1.0 } + text[ACTIVE] = { 1.0, 1.0, 1.0 } + base[NORMAL] = { 0.09, 0.48, 0.46 } + base[ACTIVE] = { 0.09, 0.48, 0.46 } + bg[NORMAL] = { 1.0, 0.48, 0.46 } + bg[ACTIVE] = { 0.09, 1.0, 0.46 } +} + +style "menu_bar_base" = "default_base" +{ + bg[NORMAL] = { 0.2, 0.2, 0.3 } + bg[ACTIVE] = { 0, 0, 0 } + bg[PRELIGHT] = { 0, 0, 0 } + bg[INSENSITIVE] = { 0, 0, 0 } + bg[SELECTED] = { 0, 0, 0 } +} + +style "fatal_message" = "medium_text" +{ + fg[ACTIVE] = { 1.0, 0, 1.0 } + fg[NORMAL] = { 0.80, 0.80, 0.80 } + bg[ACTIVE] = { 0,0,0 } + bg[NORMAL] = { 0,0,0 } + base[ACTIVE] = { 0,0,0 } + base[NORMAL] = { 0,0,0 } +} + +style "error_message" = "medium_text" +{ + fg[ACTIVE] = { 1.0, 0, 0 } + fg[NORMAL] = { 0.80, 0.80, 0.80 } + bg[ACTIVE] = { 0,0,0 } + bg[NORMAL] = { 0,0,0 } + base[ACTIVE] = { 0,0,0 } + base[NORMAL] = { 0,0,0 } +} + +style "info_message" = "medium_text" +{ + fg[ACTIVE] = { 1.0, 0, 0 } + fg[NORMAL] = { 0.80, 0.80, 0.80 } + bg[ACTIVE] = { 0,0,0 } + bg[NORMAL] = { 0,0,0 } + base[ACTIVE] = { 0,0,0 } + base[NORMAL] = { 0,0,0 } +} + +style "warning_message" = "medium_text" +{ + fg[ACTIVE] = { 0.30,0.30, 1.0 } + fg[NORMAL] = { 0.80, 0.80, 0.80 } + bg[ACTIVE] = { 0, 0, 0 } + bg[NORMAL] = { 0, 0, 0 } + base[ACTIVE] = { 0, 0, 0 } + base[NORMAL] = { 0, 0, 0 } +} + +style "medium_entry" = "medium_text" +{ + fg[NORMAL] = { 0.70, 0.70, 0.70 } + fg[ACTIVE] = { 0.70, 0.70, 0.70 } + fg[SELECTED] = { 1.0, 1.0, 1.0 } + + bg[NORMAL] = { 0.35, 0.35, 0.40 } + + base[NORMAL] = { 0, 0, 0 } + base[ACTIVE] = { 0, 0, 0 } + base[SELECTED] = { 0.70, 0.70, 0.70 } +} + +style "medium_entry_noselection_fg" = "medium_entry" +{ + fg[SELECTED] = { 0.50, 1.0, 0.50 } +} + +style "medium_entry_noselection_bg" = "medium_entry" +{ + bg[SELECTED] = { 1.0, 1.0, 1.0 } +} + +style "medium_bold_entry" = "medium_bold_text" +{ + fg[NORMAL] = { 0.70, 0.70, 0.70 } + fg[ACTIVE] = { 0.70, 0.70, 0.70 } + + bg[NORMAL] = { 0.35, 0.35, 0.40 } + + base[NORMAL] = { 0, 0, 0 } + base[ACTIVE] = { 0, 0, 0 } + base[SELECTED] = { 0, 0, 0 } +} + +style "small_entry" = "small_text" +{ + fg[NORMAL] = { 0.70, 0.70, 0.70 } + fg[ACTIVE] = { 0, 1.0, 0 } + fg[SELECTED] = { 0, 1.0, 0 } + text[NORMAL] = { 0.70, 0.70, 0.70 } + text[ACTIVE] = { 0, 1.0, 0 } + text[SELECTED] = { 0, 1.0, 0 } + bg[NORMAL] = { 0.0, 0.0, 0.0 } + bg[SELECTED] = { 0.0, 0.0, 0.0 } + bg[SELECTED] = { 0.0, 0.0, 0.0 } + base[NORMAL] = { 0, 0, 0 } + base[ACTIVE] = { 0, 0, 0 } + base[SELECTED] = { 0, 0, 0 } +} + +style "red_active_small_entry" = "small_entry" +{ + fg[ACTIVE] = { 1.0, 0.0, 0.0 } + fg[SELECTED] = { 1.0, 0, 0 } +} + +style "small_bold_entry" = "small_bold_text" +{ + fg[NORMAL] = { 0.70, 0.70, 0.70 } + fg[ACTIVE] = { 0.70, 0.70, 0.70 } + + bg[NORMAL] = { 0.35, 0.35, 0.40 } + + base[NORMAL] = { 0, 0, 0 } + base[ACTIVE] = { 0, 0, 0 } + base[SELECTED] = { 0, 0, 0 } +} + +style "small_red_on_black_entry" = "small_bold_text" +{ + fg[NORMAL] = { 1.0, 0, 0 } + fg[ACTIVE] = { 1.0, 0, 0 } + base[NORMAL] = { 0.0, 0.0, 0.0 } + base[ACTIVE] = { 0.0, 0.0, 0.0 } + bg[NORMAL] = { 0.0, 0.0, 0.0 } + bg[ACTIVE] = { 0.0, 0.0, 0.0 } +} + +style "non_recording_big_clock_display" = "medium_entry" +{ + font_name = "sans 60" + + fg[NORMAL] = { 0.50, 1.0, 0.50 } + fg[ACTIVE] = { 1.0, 0, 0.0 } + fg[SELECTED] = { 1.0, 0, 0 } + fg[PRELIGHT] = { 1.0, 0, 0.0 } + fg[INSENSITIVE] = { 1.0, 0, 0.0 } + + base[NORMAL] = { 0.0, 0.0, 0.0 } + base[ACTIVE] = { 0.0, 0.0, 0.0 } + bg[NORMAL] = { 0.0, 0.0, 0.0 } + bg[ACTIVE] = { 0.7, 0.0, 0.0 } +} + +style "recording_big_clock_display" = "non_recording_big_clock_display" +{ + fg[NORMAL] = { 1.0, 0, 0 } +} + +style "transport_clock_display" +{ + font_name = "sans bold 14" + + fg[NORMAL] = { 0.50, 1.0, 0.50 } + fg[ACTIVE] = { 1.0, 0, 0.0 } + fg[SELECTED] = { 1.0, 0, 0 } + fg[PRELIGHT] = { 1.0, 0, 0.0 } + fg[INSENSITIVE] = { 1.0, 0, 0.0 } + + base[NORMAL] = { 0.0, 0.0, 0.0 } + base[ACTIVE] = { 0.0, 0.0, 0.0 } + bg[NORMAL] = { 0.0, 0.0, 0.0 } + bg[ACTIVE] = { 0.0, 0.0, 0.0 } +} + +style "tempo_meter_clock_display" +{ + font_name = "sans 7" + fg[NORMAL] = { 1.0, 1.0, 1.0 } + fg[ACTIVE] = { 1.0, 1.0, 0.0 } + fg[SELECTED] = { 1.0, 0, 0 } + base[NORMAL] = { 0.0, 0.48, 1.0 } + base[ACTIVE] = { 0.09, 0.98, 0.46 } + bg[NORMAL] = { 0.0, 0.48, 1.0 } + bg[ACTIVE] = { 0.09, 0.98, 0.46 } +} + +style "default_clock_display" = "medium text" +{ + fg[NORMAL] = { 0.50, 1.0, 0.50 } + fg[ACTIVE] = { 1.0, 0.0, 0.0 } + fg[SELECTED] = { 1.0, 0, 0 } + base[NORMAL] = { 0, 0, 0 } + base[ACTIVE] = { 0, 0, 0 } + bg[NORMAL] = { 0, 0, 0 } + bg[ACTIVE] = { 0, 0, 0 } +} + +style "editor_time_ruler" = "small_text" +{ + fg[NORMAL] = { 0.80, 0.80, 0.80 } + bg[NORMAL] = { 0.09, 0.09, 0.09 } +} + +style "audio_track_base" = "default_base" +{ + font_name = "sans 6" + fg[NORMAL] = { 0.77, 0.77, 0.72 } + bg[NORMAL] = { 0.18, 0.19, 0.22 } + bg[ACTIVE] = { 0.20, 0.20, 0.20 } + bg[PRELIGHT] = { 0.20, 0.20, 0.20 } + bg[INSENSITIVE] = { 0.20, 0.20, 0.20 } + bg[SELECTED] = { 0.20, 0.20, 0.20 } +} + +style "audio_bus_base" +{ + font_name = "sans 6" + fg[NORMAL] = { 0.77, 0.77, 0.72 } + fg[NORMAL] = { 0.7, 0.8, 0.2 } + #bg[NORMAL] = {0, 0.36, 0.40 } + bg[NORMAL] = "#444466" +} + +style "track_name_display" +{ + font_name = "sans medium 8" + fg[NORMAL] = { 0.80, 0.80, 0.80 } + fg[ACTIVE] = { 0.80, 0.80, 0.80 } + + base[NORMAL] = { 0.06, 0.06, 0.06 } + base[ACTIVE] = { 0.26, 0.26, 0.26 } + bg[NORMAL] = { 0.26, 0.26, 0.26 } + bg[ACTIVE] = { 0.26, 0.26, 0.26 } +} + +style "active_track_name_display" +{ + font_name = "sans medium 8" + text[NORMAL] = { 0.26, 0.26, 0.26 } + base[NORMAL] = { 0.89, 0.89, 0.89 } +} + +style "track_separator" +{ + bg[NORMAL] = { 0.35, 0.35, 0.40 } +} + +# +# Track edit groups. These styles define +# the colors that the "edit" button will +# use as a track is moved from +# track edit group to track edit group. +# There are 8 edit groups. Edit group 0 +# is used for tracks that are not editable, +# so we leave its style to the default. +# + +style "edit_group_0" + +{ + bg[ACTIVE] = { 1.0, 0.65, 0.13 } + bg[NORMAL] = { 0.31, 0.31, 0.31 } + fg[NORMAL] = { 0.82, 0.91, 0.99 } + fg[ACTIVE] = { 0, 0, 0 } +} + +style "edit_group_1" +{ + fg[NORMAL] = { 0, 0, 0 } + fg[PRELIGHT] = { 0, 0, 0 } + fg[SELECTED] = { 0, 0, 0 } + bg[NORMAL] = { 0.93, 0.34, 0.08 } + bg[PRELIGHT] = { 0.93, 0.34, 0.08 } + bg[SELECTED] = { 0.93, 0.34, 0.08 } +} + +style "edit_group_2" +{ + fg[NORMAL] = { 0, 0, 0 } + fg[PRELIGHT] = { 0, 0, 0 } + fg[SELECTED] = { 0, 0, 0 } + bg[NORMAL] = { 0.93, 0.34, 0.08 } + bg[PRELIGHT] = { 0.93, 0.34, 0.08 } + bg[SELECTED] = { 0.93, 0.34, 0.08 } +} + +style "edit_group_3" +{ + fg[NORMAL] = { 0, 0, 0 } + fg[PRELIGHT] = { 0, 0, 0 } + fg[SELECTED] = { 0, 0, 0 } + bg[NORMAL] = { 0.93, 0.34, 0.08 } + bg[PRELIGHT] = { 0.93, 0.34, 0.08 } + bg[SELECTED] = { 0.93, 0.34, 0.08 } +} + +style "treeview_parent_node" +{ + # specifies *just* the color used for whole file rows when not selected + fg[NORMAL] = { 0.0, 0.6, 0.85 } +} + +style "treeview_display" = "small_bold_text" +{ + # expander arrow border and DnD "icon" text + fg[NORMAL] = { 0.8, 0.8, 0.8 } + + # background with no rows or no selection, plus + # expander arrow core and DnD "icon" background + base[NORMAL] = { 0.20, 0.20, 0.25 } + + # selected row bg when window does not have focus (including during DnD) + base[ACTIVE] = { 0.0, 0.60, 0.60 } + + # selected row bg when window has focus + base[SELECTED] = { 0, 0.75, 0.75 } + + # row text when in normal state and not a parent + text[NORMAL] = { 0.80, 0.80, 0.80 } + + # selected row text with window focus + text[SELECTED] = { 0, 1.0, 1.0 } + + # selected row text without window focus (including during DnD) + text[ACTIVE] = { 0, 1.0, 1.0 } +} + +style "main_canvas_area" +{ + bg[NORMAL] = { 0.30, 0.30, 0.34 } + bg[ACTIVE] = { 0.30, 0.30, 0.34 } + bg[INSENSITIVE] = { 0.30, 0.30, 0.34 } + bg[SELECTED] = { 0.30, 0.30, 0.34 } + bg[PRELIGHT] = { 0.30, 0.30, 0.34 } +} + +style "track_controls_inactive" +{ + bg[NORMAL] = { 0.60, 0.60, 0.66 } + bg[ACTIVE] = { 0.60, 0.60, 0.66 } + bg[INSENSITIVE] = { 0.60, 0.60, 0.66 } + bg[SELECTED] = { 0.60, 0.60, 0.66 } + bg[PRELIGHT] = { 0.60, 0.60, 0.66 } + + font_name = "sans medium 10" + fg[NORMAL] = { 0.7, 0.8, 0.2 } +} + +style "edit_controls_base_selected" +{ + bg[NORMAL] = { 0.60, 0.54, 0.60 } + bg[ACTIVE] = { 0.60, 0.54, 0.60 } + bg[INSENSITIVE] = { 0.60, 0.54, 0.60 } + bg[SELECTED] = { 0.60, 0.54, 0.60 } + bg[PRELIGHT] = { 0.60, 0.54, 0.60 } +} + +style "automation_track_controls_base" +{ + bg[NORMAL] = { 0.22, 0.22, 0.29 } + bg[ACTIVE] = { 0.22, 0.22, 0.29 } + bg[INSENSITIVE] = { 0.22, 0.22, 0.29 } + bg[SELECTED] = { 0.22, 0.22, 0.29 } + bg[PRELIGHT] = { 0.22, 0.22, 0.29 } +} + +# Plugin Editors +style "plugin_slider" +{ + font_name ="sans bold 10" + + # the slider itself. the inactive part is INSENSITIVE, + # the active part is something else. + + fg[NORMAL] = { 0.37, 0.43, 0.52 } + fg[ACTIVE] = { 0.37, 0.43, 0.52 } + fg[INSENSITIVE] = {0.35, 0.35, 0.40 } # matches default_base + fg[SELECTED] = { 0.37, 0.43, 0.52 } + fg[PRELIGHT] = { 0.37, 0.43, 0.52 } + + # draws the outer rectangle around the slider + + bg[NORMAL] = { 0.80, 0.80, 0.80 } + bg[ACTIVE] = { 0.80, 0.80, 0.80 } + bg[INSENSITIVE] = {0.80, 0.80, 0.80 } + bg[SELECTED] = { 0.80, 0.80, 0.80 } + bg[PRELIGHT] = { 0.80, 0.80, 0.80 } + + # the numeric display + + text[NORMAL] = { 0.80, 0.80, 0.80 } + text[ACTIVE] = { 0.80, 0.80, 0.80 } + text[INSENSITIVE] = { 0.80, 0.80, 0.80 } + text[SELECTED] = { 0.80, 0.80, 0.80 } + text[PRELIGHT] = { 0.80, 0.80, 0.80 } +} + +style "track_list_display" = "small_bold_text" +{ + text[NORMAL] = { 0.80, 0.80, 0.80 } + text[ACTIVE] = { 0.3, 0.3, 0.3 } + text[INSENSITIVE] = { 0, 0, 0 } + text[SELECTED] = { 0.8, 0.8, 0.8 } + + base[NORMAL] = { 0, 0, 0 } + base[ACTIVE] = { 0, 0, 0 } + base[INSENSITIVE] = { 0, 0, 0 } + base[SELECTED] = { 0, 0, 0 } +} + +style "inspector_track_list_display" = "track_list_display" +{ + text[ACTIVE] = { 0.8, 0.8, 0.8 } + + base[NORMAL] = { 0, 0, 0 } + base[ACTIVE] = { 0.2, 0.2, 0.2 } + base[INSENSITIVE] = { 0, 0, 0 } + base[SELECTED] = { 0.3, 0.3, 0.4 } +} + +style "redirect_list_display" +{ + GtkTreeView::horizontal-separator = 0 + GtkTreeView::vertical-separator = 0 + + font_name = "sans 7" + text[NORMAL] = { 0.80, 0.80, 0.80 } + text[ACTIVE] = { 0.70, 0.70, 0.70 } + text[INSENSITIVE] = { 0, 0, 0 } + text[SELECTED] = { 0.9, 0.3, 0.3 } + + base[NORMAL] = { 0, 0, 0 } + base[ACTIVE] = { 0, 0, 0 } + base[INSENSITIVE] = { 0, 0, 0 } + base[SELECTED] = { 0, 0, 0 } + + # these two are explicitly used by the cell renderer for the + # text + + fg[NORMAL] = { 0.5, 0.5, 0.5 } # used for inactive + fg[ACTIVE] = { 1.0, 1.0, 1.0 } # used for active +} + +style "inspector_redirect_list_display" = "redirect_list_display" +{ + base[SELECTED] = { 0.3, 0.3, 0.3 } +} + +# MixerPanZone: +# +# the NORMAL fg color is used for the pan puck +# the ACTIVE fg color is used for the speaker boxes + +style "pan_zone" = "default_base" +{ + fg[NORMAL] = { 0.34, 0.95, 0.92 } + fg[ACTIVE] = { 0.95, 0.48, 0.11 } +} + +style "paler_red_when_active" = "medium_text" +{ + fg[NORMAL] = { 0.80, 0.80, 0.80 } + fg[PRELIGHT] = { 0.80, 0.80, 0.80 } + bg[NORMAL] = { 0.31, 0.31, 0.31 } + bg[PRELIGHT] = { 0.31, 0.31, 0.31 } + + fg[ACTIVE] = { 0.36, 0.46, 0.28 } + bg[ACTIVE] = { 1.00, 0.59, 0.59} +} + +style "peak_display_peaked_entry" = "small_text" +{ + fg[NORMAL] = { 1.0, 1.0, 1.0 } + fg[ACTIVE] = { 1.0, 1.0, 1.0 } + fg[SELECTED] = { 1.0, 1.0, 1.0 } + + bg[NORMAL] = {0.9, 0.0, 0.0 } + bg[ACTIVE] = { 0.9, 0.0, 0.0 } + bg[PRELIGHT] = { 0.9, 0.0, 0.0 } + bg[INSENSITIVE] = { 0.9, 0.0, 0.0 } + bg[SELECTED] = { 0.9, 0.0, 0.0 } + base[NORMAL] = { 0.9, 0.0, 0.0 } + base[ACTIVE] = { 0.9, 0.0, 0.0 } + base[PRELIGHT] = { 0.9, 0.0, 0.0 } + base[INSENSITIVE] = { 0.9, 0.0, 0.0 } + base[SELECTED] = { 0.9, 0.0, 0.0 } +} + +style "selected_strip_frame" +{ + fg[NORMAL] = { 0.74, 0.42, 0.47 } + bg[NORMAL] = { 0.79, 0.28, 0.18 } +} + +style "flashing_alert" = "very_small_text" +{ + fg[NORMAL] = { 0.80, 0.80, 0.80 } + bg[NORMAL] = { 0.26, 0.26, 0.31 } + + fg[ACTIVE] = { 0.80, 0.80, 0.80 } + bg[ACTIVE] = { 1.0, 0, 0} +} + +style "selected_io_selector_port_list" = "medium_bold_text" +{ + + GtkTreeView::even-row-color = { 0, 0, 0 } + GtkTreeView::odd-row-color = { 0, 0, 0 } + +# fg is used to color the fg (text) of the column header button + + fg[NORMAL] = { 0.85, 0.85, 0.85 } + fg[SELECTED] = { 0.85, 0.85, 0.85 } + fg[ACTIVE] = { 0.85, 0.85, 0.85 } + fg[PRELIGHT] = { 0.85, 0.85, 0.85 } + fg[INSENSITIVE] = { 0.85, 0.85, 0.85 } + +# bg is used used to color the background of the column header button + + bg[NORMAL] = { 0.30, 0.30, 0.35 } + bg[ACTIVE] = { 0.30, 0.30, 0.35 } + bg[PRELIGHT] = { 0.30, 0.30, 0.35 } + bg[INSENSITIVE] = { 0.30, 0.30, 0.35 } + bg[SELECTED] = { 0.30, 0.30, 0.35 } + +# text is used to color the treeview row text + + text[NORMAL] = { 0.85, 0.85, 0.85 } + text[SELECTED] = { 0.85, 0.85, 0.85 } + +# base is used to color a treeview with no rows + + base[NORMAL] = { 0.20, 0.20, 0.25 } + base[ACTIVE] = { 0.20, 0.20, 0.25 } + base[PRELIGHT] = { 0.20, 0.20, 0.25 } + base[INSENSITIVE] = { 0.20, 0.20, 0.25 } + base[SELECTED] = { 0.20, 0.20, 0.25 } + +} + +style "io_selector_port_list" = "medium_text" +{ + GtkTreeView::even-row-color = { 0.20, 0.20, 0.25 } + GtkTreeView::odd-row-color = { 0.20, 0.20, 0.25 } +# fg is used to color the fg (text) of the column header button + + fg[NORMAL] = { 0.70, 0.70, 0.70 } + fg[SELECTED] = { 0.70, 0.70, 0.70 } + fg[ACTIVE] = { 0.70, 0.70, 0.70 } + fg[PRELIGHT] = { 0.70, 0.70, 0.70 } + fg[INSENSITIVE] = { 0.70, 0.70, 0.70 } + +# bg is used used to color the background of the column header button + + bg[NORMAL] = { 0.30, 0.30, 0.35 } + bg[ACTIVE] = { 0.30, 0.30, 0.35 } + bg[PRELIGHT] = { 0.30, 0.30, 0.35 } + bg[INSENSITIVE] = { 0.30, 0.30, 0.35 } + bg[SELECTED] = { 0.30, 0.30, 0.35 } + +# text is used to color the treeview row text + + text[NORMAL] = { 0.80, 0.80, 0.80 } + text[SELECTED] = { 0.80, 0.80, 0.80 } + +# base is used to color a treeview with no rows + + base[NORMAL] = { 0.20, 0.20, 0.25 } + base[ACTIVE] = { 0.20, 0.20, 0.25 } + base[PRELIGHT] = { 0.20, 0.20, 0.25 } + base[INSENSITIVE] = { 0.20, 0.20, 0.25 } + base[SELECTED] = { 0.20, 0.20, 0.25 } +} + +style "io_selector_notebook" = "default_base" +{ + fg[NORMAL] = { 1.0, 1.0, 1.0 } + font_name ="sans bold 8" +} + +style "tearoff_arrow" = "medium_bold_entry" +{ + fg[NORMAL] = { 0.80, 0.80, 0.80 } + fg[PRELIGHT] = { 0.80, 0.80, 0.80 } + bg[NORMAL] = { 0.80, 0.80, 0.80 } + bg[PRELIGHT] = { 0.80, 0.80, 0.80 } +} + +style "meter_metrics_strip" = "default_base" +{ + font_name = "sans 4" + fg[NORMAL] = { 1.0, 0.8, 0.2 } +} + +style "location_row_button" = "default_buttons_menus" +{ + font_name = "sans 10" +} + +style "location_rows_clock" = "default_clock_display" +{ + font_name = "sans 12" +} + +style "pan_slider" +{ + font_name = "sans 8" + + fg[NORMAL] = { 0.22, 0.73, 0.22 } + fg[ACTIVE] = { 0.22, 0.73, 0.22 } + fg[INSENSITIVE] = {0.22, 0.53, 0.22 } + fg[SELECTED] = { 0.67, 0.23, 0.22 } + fg[PRELIGHT] = { 0.67, 0.23, 0.22 } + + bg[NORMAL] = { 0.05, 0.05, 0.05 } + bg[ACTIVE] = { 0, 0, 0 } + bg[INSENSITIVE] = {0.12, 0.19, 0.25 } + bg[SELECTED] = { 0, 0, 0 } + bg[PRELIGHT] = { 0, 0, 0 } + + text[NORMAL] = { 0.70, 0.70, 0.70 } + text[ACTIVE] = { 0.70, 0.70, 0.70 } + text[INSENSITIVE] = { 0.70, 0.70, 0.70 } + text[SELECTED] = { 0.70, 0.70, 0.70 } + text[PRELIGHT] = { 0.70, 0.70, 0.70 } + + # used to draw the triangular indicators + + base[NORMAL] = { 0.80, 0.80, 0.80 } + base[ACTIVE] = { 0.80, 0.80, 0.80 } + base[INSENSITIVE] = {0.6, 0.6, 0.6 } + base[SELECTED] = { 0.80, 0.80, 0.80 } + base[PRELIGHT] = { 0.80, 0.80, 0.80 } + +} + +style "ardour_button" ="default_buttons_menus" +{ + xthickness = 1 + ythickness = 1 +} + +#--------------------------------------------------------------- + +class "GtkWidget" style:highest "default_base" +class "GtkScrollbar" style:highest "ardour_adjusters" +class "GtkLabel" style:highest "default_buttons_menus" +class "GtkButton" style:highest "ardour_button" +class "GtkArrow" style:highest "tearoff_arrow" +class "GtkProgressBar" style:highest "ardour_progressbars" + +widget "*FirstActionMessage" style:highest "first_action_message" +widget "*VerboseCanvasCursor" style:highest "verbose_canvas_cursor" +widget "*MarkerText" style:highest "marker_text" +widget "*TimeAxisViewItemName*" style:highest "time_axis_view_item_name" +#widget "*ExportProgress" style:highest "default_buttons_menus" +widget "*ExportFileLabel" style:highest "small_bold_text" +widget "*ExportFormatLabel" style:highest "medium_bold_text" +widget "*ExportHeader" style:highest "small_bold_text" +widget "*ExportFileDisplay" style:highest "medium_entry" +widget "*ExportFormatDisplay" style:highest "medium_entry" +widget "*ExportCheckbox" style:highest "small_entry" +widget "*ExportTrackSelector*" style:highest "medium_entry_noselection_bg" +widget "*EditModeSelector" style:highest "medium_bold_entry" +widget "*SnapTypeSelector" style:highest "medium_bold_entry" +widget "*SnapModeSelector" style:highest "medium_bold_entry" +widget "*ZoomFocusSelector" style:highest "medium_bold_entry" +widget "*ArdourContextMenu*" style:highest "default_buttons_menus" +widget "*EditGroupTitleButton*" style:highest "default_buttons_menus" +widget "*MixerGroupTitleButton*" style:highest "default_buttons_menus" +widget "*ErrorLogCloseButton" style:highest "default_buttons_menus" +widget "*EditorGTKButton*" style:highest "default_buttons_menus" +widget "*ToolbarButton" style:highest "default_buttons_menus" +widget "*ToolbarButton*" style:highest "default_buttons_menus" +widget "*CrossfadeEditButton" style:highest "default_buttons_menus" +widget "*CrossfadeEditButton*" style:highest "default_buttons_menus" +widget "*TrackHistoryButton*" style:highest "default_buttons_menus" +widget "*TrackSizeButton*" style:highest "default_buttons_menus" +widget "*TrackPlaylistButton*" style:highest "default_buttons_menus" +widget "*TrackAutomationButton*" style:highest "default_buttons_menus" +widget "*TrackGroupButton*" style:highest "default_buttons_menus" +widget "*TrackMixButton*" style:highest "default_buttons_menus" +widget "*TrackVisualButton*" style:highest "default_buttons_menus" +widget "*TrackRemoveButton*" style:highest "default_buttons_menus" +widget "*BaseButton" style:highest "default_buttons_menus" +widget "*TakeButtonLabel" style:highest "default_buttons_menus" +widget "*MixerWidthButton" style:highest "default_buttons_menus" +widget "*MixerHideButton" style:highest "default_buttons_menus" +widget "*MixerSendButton" style:highest "default_buttons_menus" +widget "*MixerSendButtonLabel" style:highest "default_buttons_menus" +widget "*MixerSendSwitch" style:highest "default_buttons_menus" +widget "*MixerInsertButton" style:highest "default_buttons_menus" +widget "*MixerInsertButtonLabel" style:highest "default_buttons_menus" +widget "*MixerInsertSwitch" style:highest "default_buttons_menus" +widget "*MixerMonitorInputButton*" style:highest "very_small_button" +widget "*MixerMonitorInputButton.*" style:highest "very_small_button" +widget "*MixerIOButton" style:highest "very_small_button" +widget "*MixerIOButtonLabel" style:highest "very_small_button" +widget "*AddRouteDialogSpinner" style:highest "ardour_adjusters" +widget "*AddRouteDialogRadioButton*" style:highest "options_window" +widget "*OptionsNotebook" style:highest "options_window" +widget "*OptionEditorToggleButton*" style:highest "options_window" +widget "*OptionsLabel" style:highest "options_window" +widget "*OptionEditorAuditionerLabel" style:highest "options_window" +widget "*OptionsEntry" style:highest "option_entry" +widget "*InspectorNotebook" style:highest "options_window" +widget "*NewSessionDialog" style:highest "options_window" +widget "*NewSessionDialogButton*" style:highest "options_window" +widget "*MixerSendSwitch*" style:highest "very_small_red_active_and_selected_button" +widget "*OptionEditorToggleButton" style:highest "small_red_active_and_selected_button" +widget "*NewSessionDialogButton" style:highest "small_red_active_and_selected_button" +widget "*RecordEnableButton" style:highest "track_rec_enable_button" +widget "*RecordEnableButton-active" style:highest "track_rec_enable_button_active" +widget "*RecordEnableButton-alternate" style:highest "track_rec_enable_button_alternate" +widget "*MixerRecordEnableButton" style:highest "mixer_track_rec_enable_button" +widget "*MixerRecordEnableButton-active" style:highest "mixer_track_rec_enable_button_active" +widget "*MixerRecordEnableButton-alternate" style:highest "mixer_track_rec_enable_button_alternate" +widget "*MuteButton" style:highest "mute_button" +widget "*MuteButton-alternate" style:highest "mute_button_alternate" +widget "*MuteButton-active" style:highest "mute_button_active" +widget "*MixerMuteButton" style:highest "mixer_mute_button" +widget "*MixerMuteButton-alternate" style:highest "mixer_mute_button_alternate" +widget "*MixerMuteButton-active" style:highest "mixer_mute_button_active" +widget "*SoloButton" style:highest "solo_button" +widget "*SoloButton-alternate" style:highest "solo_button_alternate" +widget "*SoloButton-active" style:highest "solo_button_active" +widget "*MixerSoloButton" style:highest "mixer_solo_button" +widget "*MixerSoloButton-alternate" style:highest "mixer_solo_button_alternate" +widget "*MixerSoloButton-active" style:highest "mixer_solo_button_active" +widget "*TrackLoopButton*" style:highest "track_loop_button" +widget "*PanAutomationLineSelector*" style:highest "multiline_combo" +widget "*EditorTimeButton*" style:highest "time_button" +widget "*MixerPhaseInvertButton*" style:highest "very_small_button" +widget "*MixerPhaseInvertButton.*" style:highest "very_small_button" +widget "*MixerAutomationRecordingButton*" style:highest "very_small_button" +widget "*MixerAutomationRecordingButton.*" style:highest "very_small_button" +widget "*MixerAutomationModeButton*" style:highest "very_small_button" +widget "*MixerAutomationModeButton.*" style:highest "very_small_button" +widget "*MixerAutomationPlaybackButton*" style:highest "very_small_button" +widget "*MixerAutomationPlaybackButton.*" style:highest "very_small_button" +widget "*MixerNameButton" style:highest "very_small_button" +widget "*MixerNameButtonLabel" style:highest "very_small_button" +widget "*MixerGroupButton" style:highest "very_small_button" +widget "*MixerGroupButtonLabel" style:highest "very_small_button" +widget "*MixerCommentButton" style:highest "very_small_button" +widget "*MixerCommentButton*" style:highest "very_small_button" +widget "*EditGroupButton" style:highest "very_small_button" +widget "*EditGroupButtonLabel" style:highest "very_small_button" +widget "*TransportButton" style:highest "transport_rec_button" +widget "*TransportButton-active" style:highest "transport_button_active" +widget "*ShuttleButton" style:highest "transport_button" +widget "*ShuttleButton*" style:highest "transport_button" +widget "*ShuttleDisplay" style:highest "transport_button" +widget "*ShuttleDisplay*" style:highest "transport_button" +widget "*ShuttleControl" style:highest "shuttle_control" +widget "*TransportRecButton" style:highest "transport_rec_button" +widget "*TransportRecButton*" style:highest "transport_rec_button" +widget "*TransportRecButton-active" style:highest "transport_rec_button_active" +widget "*TransportRecButton-active*" style:highest "transport_rec_button_active" +widget "*TransportRecButton-alternate" style:highest "transport_rec_button_alternate" +widget "*TransportRecButton-alternate*" style:highest "transport_rec_button_alternate" +widget "*TransportRecButton*" style:highest "transport_rec_button" +widget "*RecordingXrunWarningWindow" style:highest "xrun_warn" +widget "*RecordingXrunWarningWindow*" style:highest "xrun_warn" +widget "*MainMenuBar" style:highest "menu_bar_base" +widget "*ErrorMessage" style:highest "error_message" +widget "*FatalMessage" style:highest "fatal_message" +widget "*InfoMessage" style:highest "info_message" +widget "*WarningMessage" style:highest "warning_message" +widget "*BigClockNonRecording" style:highest "non_recording_big_clock_display" +widget "*BigClockRecording" style:highest "recording_big_clock_display" +widget "*TransportClockDisplay" style:highest "transport_clock_display" +widget "*SecondaryClockDisplay" style:highest "transport_clock_display" +widget "*AudioClockFramesUpperInfo" style:highest "tempo_meter_clock_display" +widget "*AudioClockFramesLowerInfo" style:highest "tempo_meter_clock_display" +widget "*AudioClockSMPTEUpperInfo" style:highest "tempo_meter_clock_display" +widget "*AudioClockSMPTELowerInfo" style:highest "tempo_meter_clock_display" +widget "*AudioClockBBTUpperInfo" style:highest "tempo_meter_clock_display" +widget "*AudioClockBBTLowerInfo" style:highest "tempo_meter_clock_display" +widget "*SelectionStartClock" style:highest "default_clock_display" +widget "*SelectionEndClock" style:highest "default_clock_display" +widget "*EditCursorClock" style:highest "default_clock_display" +widget "*PreRollClock" style:highest "default_clock_display" +widget "*PostRollClock" style:highest "default_clock_display" +widget "*NudgeClock" style:highest "default_clock_display" +widget "*ZoomRangeClock" style:highest "default_clock_display" +widget "*SMPTEOffsetClock" style:highest "default_clock_display" +widget "*TransportLabel" style:highest "small_bold_text" +widget "*TakeLabel" style:highest "small_bold_text" +widget "*LocationLabel" style:highest "small_bold_text" +widget "*WipeLabel" style:highest "small_bold_text" +widget "*TakeTagLabel" style:highest "small_bold_text" +widget "*ToolBarLabel" style:highest "small_bold_text" +widget "*EditorDisplayLabel" style:highest "small_bold_text" +widget "*NewSessionLabel" style:highest "large_text" +widget "*GlobalButtonLabel" style:highest "default_buttons_menus" +widget "*ClickButton" style:highest "medium_entry" +widget "*RegionNameDisplay" style:highest "medium_entry" +widget "*PluginDisplay" style:highest "medium_entry" +widget "*SelectionDisplay" style:highest "medium_entry" +widget "*HistorySelector" style:highest "medium_entry" +widget "*LocationSelector" style:highest "medium_entry" +widget "*TakeSelector" style:highest "medium_entry" +widget "*RegionSelector" style:highest "medium_entry" +widget "*SMPTERuler" style:highest "editor_time_ruler" +widget "*BBTRuler" style:highest "editor_time_ruler" +widget "*FramesRuler" style:highest "editor_time_ruler" +widget "*MinSecRuler" style:highest "editor_time_ruler" +widget "*BaseFrame" style:highest "base_frame" +widget "*AudioTrackStripBase" style:highest "audio_track_base" +widget "*TimeAxisViewControlsBaseUnselected" style:highest "audio_track_base" +widget "*AudioTrackControlsBaseUnselected" style:highest "audio_track_base" +widget "*AudioTrackFader" style:highest "gain_fader" +widget "*AudioBusStripBase" style:highest "audio_bus_base" +widget "*BusControlsBaseUnselected" style:highest "audio_bus_base" +widget "*AudioBusFader" style:highest "gain_fader" +widget "*TrackSeparator" style:highest "track_separator" +widget "*TrackEditIndicator0*" style:highest "edit_group_0" +widget "*TrackEditIndicator1*" style:highest "edit_group_1" +widget "*TrackEditIndicator2*" style:highest "edit_group_2" +widget "*TrackEditIndicator3*" style:highest "edit_group_3" +widget "*TrackEditIndicator4*" style:highest "edit_group_3" +widget "*TrackEditIndicator5*" style:highest "edit_group_3" +widget "*TrackEditIndicator6*" style:highest "edit_group_3" +widget "*TrackEditIndicator7*" style:highest "edit_group_3" +widget "*EditorTrackNameDisplay" style:highest "track_name_display" +widget "*EditorTrackNameDisplay*" style:highest "track_name_display" +widget "*EditorActiveTrackNameDisplay" style:highest "active_track_name_display" +widget "*EditorActiveTrackNameDisplay*" style:highest "active_track_name_display" +widget "*CrossfadeEditAuditionButton" style:highest "red_when_active" +widget "*CrossfadeEditAuditionButton*" style:highest "red_when_active" +widget "*CrossfadeEditCurveButton" style:highest "red_when_active" +widget "*CrossfadeEditCurveButton*" style:highest "red_when_active" +widget "*CrossfadeEditLabel" style:highest "medium_text" +widget "*CrossfadeEditFrame" style:highest "base_frame" +widget "*MouseModeButton" style:highest "default_buttons_menus" +widget "*MouseModeButton*" style:highest "default_buttons_menus" +widget "*EditorMainCanvas" style:highest "main_canvas_area" +widget "*AudioTrackControlsBaseInactiveUnselected" style:highest "track_controls_inactive" +widget "*BusControlsBaseInactiveUnselected" style:highest "track_controls_inactive" +widget "*AutomationTrackControlsBaseInactiveUnselected" style:highest "track_controls_inactive" +widget "*AutomationTrackName" style:highest "automation_track_name" +widget "*AudioTrackControlsBaseInactiveSelected" style:highest "track_controls_inactive" +widget "*BusControlsBaseInactiveSelected" style:highest "track_controls_inactive" +widget "*AutomationTrackControlsBaseInactiveSelected" style:highest "track_controls_inactive" +widget "*AudioTrackStripBaseInactive" style:highest "track_controls_inactive" +widget "*AudioBusStripBaseInactive" style:highest "track_controls_inactive" +widget "*AudioTrackControlsBaseSelected" style:highest "edit_controls_base_selected" +widget "*BusControlsBaseSelected" style:highest "edit_controls_base_selected" +widget "*AutomationTrackControlsBase" style:highest "automation_track_controls_base" +widget "*AutomationTrackControlsBaseSelected" style:highest "edit_controls_base_selected" +widget "*EditorMenuBar*" style:highest "black_mackie_menu_bar" +widget "*MainMenuBar*" style:highest "black_mackie_menu_bar" +widget "*ZoomClickBox" style:highest "medium_bold_entry" +widget "*PluginParameterLabel" style:highest "medium_text" +widget "*PluginNameInfo" style:highest "plugin_name_text" +widget "*PluginMakerInfo" style:highest "plugin_maker_text" +widget "*PluginParameterInfo" style:highest "medium_text" +widget "*MotionControllerValue" style:highest "medium_entry" +widget "*ParameterValueDisplay" style:highest "medium_bold_entry" +widget "*PluginUIClickBox" style:highest "medium_bold_entry" +widget "*PluginUIClickBox*" style:highest "medium_bold_entry" +widget "*PluginSlider" style:highest "plugin_slider" +widget "*RedirectSelector" style:highest "redirect_list_display" +widget "*RedirectSelector.*" style:highest "redirect_list_display" +widget "*EditGroupDisplay" style:highest "treeview_display" +widget "*TrackListDisplay" style:highest "treeview_display" +widget "*RegionListDisplay" style:highest "treeview_display" +widget "*NamedSelectionDisplay" style:highest "treeview_display" +widget "*SnapshotDisplay" style:highest "treeview_display" +widget "*MixerTrackCommentArea" style:highest "option_entry" +widget "*MixerPanZone" style:highest "pan_zone" +widget "*MixerTrackDisplayList" style:highest "treeview_display" +widget "*MixerSnapshotDisplayList" style:highest "treeview_display" +widget "*MixerAuxDisplayList" style:highest "treeview_display" +widget "*MixerGroupList" style:highest "treeview_display" +widget "*RegionEditorLabel" style:highest "medium_text" +widget "*RegionEditorSmallLabel" style:highest "small_text" +widget "*RegionEditorEntry" style:highest "medium_entry" +widget "*RegionEditorClock" style:highest "default_clock_display" +widget "*RegionEditorToggleButton" style:highest "paler_red_when_active" +widget "*RegionEditorToggleButton*" style:highest "paler_red_when_active" +widget "*MixerStripSpeedBase" style:highest "small_entry" +widget "*MixerStripSpeedBase*" style:highest "small_entry" +widget "*MixerStripSpeedBaseNotOne" style:highest "small_red_on_black_entry" +widget "*MixerStripSpeedBaseNotOne*" style:highest "small_red_on_black_entry" +widget "*MixerStripGainDisplay" style:highest "small_entry" +widget "*MixerStripGainDisplay*" style:highest "small_entry" +widget "*MixerStripGainUnitButton" style:highest "very_small_button" +widget "*MixerStripGainUnitButton*" style:highest "very_small_button" +widget "*MixerStripMeterPreButton" style:highest "very_small_button" +widget "*MixerStripMeterPreButton*" style:highest "very_small_button" +widget "*MixerStripPeakDisplay*" style:highest "red_active_small_entry" +widget "*MixerStripPeakDisplayPeak*" style:highest "peak_display_peaked_entry" +widget "*MixerStripSelectedFrame" style:highest "selected_strip_frame" +widget "*MixerStripFrame" style:highest "base_frame" +widget "*HWMonitorButton" style:highest "red_when_active" +widget "*HWMonitorButton*" style:highest "red_when_active" +widget "*BypassButton" style:highest "red_when_active" +widget "*BypassButton*" style:highest "red_when_active" +widget "*TransportSoloAlert" style:highest "flashing_alert" +widget "*TransportSoloAlert.*" style:highest "flashing_alert" +widget "*TransportAuditioningAlert" style:highest "flashing_alert" +widget "*TransportAuditioningAlert.*" style:highest "flashing_alert" +widget "*FadeCurve" style:highest "medium_bold_entry" +widget "*FadeCurve*" style:highest "medium_bold_entry" +widget "*IOSelectorButton" style:highest "default_buttons_menus" +widget "*IOSelectorButton*" style:highest "default_buttons_menus" +widget "*IOSelectorList" style:highest "medium_entry_noselection_fg" +widget "*IOSelectorPortList" style:highest "io_selector_port_list" +widget "*IOSelectorPortList.*" style:highest "io_selector_port_list" +widget "*IOSelectorPortListSelected" style:highest "selected_io_selector_port_list" +widget "*IOSelectorPortListSelected.*" style:highest "selected_io_selector_port_list" +widget "*IOSelectorNotebook" style:highest "io_selector_notebook" +widget "*IOSelectorNotebookTab" style:highest "io_selector_notebook" +widget "*IOSelectorFrame" style:highest "base_frame" +widget "*ConnectionEditorButton" style:highest "default_buttons_menus" +widget "*ConnectionEditorButton*" style:highest "default_buttons_menus" +widget "*ConnectionEditorList" style:highest "medium_entry_noselection_fg" +widget "*ConnectionEditorConnectionList" style:highest "medium_entry" +widget "*ConnectionEditorPortList" style:highest "io_selector_port_list" +widget "*ConnectionEditorPortListSelected" style:highest "selected_io_selector_port_list" +widget "*ConnectionEditorNotebook" style:highest "io_selector_notebook" +widget "*ConnectionEditorNotebookTab" style:highest "io_selector_notebook" +widget "*ConnectionEditorFrame" style:highest "base_frame" +widget "*RouteParamsListDisplay" style:highest "inspector_track_list_display" +widget "*RouteParamsPreListDisplay" style:highest "inspector_redirect_list_display" +widget "*RouteParamsPostListDisplay" style:highest "inspector_redirect_list_display" +widget "*TearOffArrow" style:highest "tearoff_arrow" +widget "*RouteParamsTitleButton" style:highest "medium_text" +widget "*RouteParamsTitleLabel" style:highest "medium_text" +widget "*PluginAutomateRecordButton" style:highest "small_red_active_and_selected_button" +widget "*PluginAutomateRecordButton*" style:highest "small_red_active_and_selected_button" +widget "*PluginAutomatePlayButton" style:highest "small_red_active_and_selected_button" +widget "*PluginAutomatePlayButton*" style:highest "small_red_active_and_selected_button" +widget "*PluginAutomateButton" style:highest "small_button" +widget "*PluginAutomateButton*" style:highest "small_button" +widget "*PluginSaveButton" style:highest "small_button" +widget "*PluginSaveButton*" style:highest "small_button" +widget "*PluginLoadButton" style:highest "small_button" +widget "*PluginLoadButton*" style:highest "small_button" +widget "*FaderMetricsStrip" style:highest "meter_metrics_strip" +widget "*MeterMetricsStrip" style:highest "meter_metrics_strip" +widget "*MetricDialogFrame" style:highest "base_frame" +widget "*MetricEntry" style:highest "medium_bold_entry" +widget "*MetricButton" style:highest "default_buttons_menus" +widget "*MetricButton.*" style:highest "default_buttons_menus" +widget "*MetricLabel" style:highest "medium_text" +widget "*TimeStretchButton" style:highest "default_buttons_menus" +widget "*TimeStretchButton.*" style:highest "default_buttons_menus" +widget "*TimeStretchProgress" style:highest "default_buttons_menus" +widget "*ChoiceWindow" style:highest "default_buttons_menus" +widget "*ChoicePrompt" style:highest "default_buttons_menus" +widget "*ChoiceButton" style:highest "default_buttons_menus" +widget "*ChoiceButton*" style:highest "default_buttons_menus" +widget "*SelectionModeButton" style:highest "default_buttons_menus" +widget "*SelectionModeButton*" style:highest "default_buttons_menus" +widget "*TrackLabel" style:highest "medium_text" +widget "*TrackPlugName" style:highest "medium_text" +widget "*TrackParameterName" style:highest "small_text" +widget "*AddRouteDialog*" style:highest "medium_text" +widget "*AddRouteDialog.GtkLabel" style:highest "medium_text" +widget "*AddRouteDialogChannelChoice" style:highest "medium_bold_entry" +widget "*AddRouteDialogSpinner" style:highest "medium_bold_entry" +widget "*AddRouteDialogSpinner*" style:highest "medium_bold_entry" +widget "*AddRouteDialogRadioButton" style:highest "red_when_active" +widget "*AddRouteDialogButton" style:highest "default_buttons_menus" +widget "*AddRouteDialogNameTemplateEntry" style:highest "medium_bold_entry" +widget "*NewSessionIOLabel" style:highest "larger_bold_text" +widget "*NewSessionSR1Label" style:highest "red_medium_text" +widget "*NewSessionSR2Label" style:highest "medium_text" +widget "*NewSessionChannelChoice" style:highest "medium_bold_entry" +widget "*NewSessionMainButton" style:highest "larger_bold_text" +widget "*NewSessionMainButton*" style:highest "larger_bold_text" +widget "*NewSessionMainLabel" style:highest "larger_bold_text" +widget "*LocationEditRowClock" style:highest "location_rows_clock" +widget "*LocationEditNameLabel" style:highest "medium_text" +widget "*LocationEditSetButton" style:highest "location_row_button" +widget "*LocationEditSetButton*" style:highest "location_row_button" +widget "*LocationEditGoButton" style:highest "location_row_button" +widget "*LocationEditGoButton*" style:highest "location_row_button" +widget "*LocationEditCdButton" style:highest "small_red_active_and_selected_button" +widget "*LocationEditCdButton*" style:highest "small_red_active_and_selected_button" +widget "*LocationEditHideButton" style:highest "small_red_active_and_selected_button" +widget "*LocationEditHideButton*" style:highest "small_red_active_and_selected_button" +widget "*LocationEditNumberLabel" style:highest "small_text" +widget "*LocationLocEditorFrame" style:highest "base_frame" +widget "*LocationRangeEditorFrame" style:highest "base_frame" +widget "*LocationEditNameEntry" style:highest "option_entry" +widget "*LocationAddLocationButton" style:highest "default_buttons_menus" +widget "*LocationAddLocationButton*" style:highest "default_buttons_menus" +widget "*LocationAddRangeButton" style:highest "default_buttons_menus" +widget "*LocationAddRangeButton*" style:highest "default_buttons_menus" +widget "*LocationEditRemoveButton" style:highest "location_row_button" +widget "*LocationEditRemoveButton*" style:highest "location_row_button" +widget "*PanSlider" style:highest "pan_slider" +widget "*PanningLinkButton" style:highest "mixer_red_active_button" +widget "*PanningLinkButton.*" style:highest "mixer_red_active_button" +widget "*PanningLinkDirectionButton" style:highest "very_small_button" +widget "*PanningLinkDirectionButton.*" style:highest "very_small_button" +widget "*ChannelCountSelector" style:highest "medium_bold_entry" +widget "*ChannelCountSelector.GtkArrow" style:highest "default_buttons_menus" +widget "*RegionListWholeFile" style:highest "treeview_parent_node" +widget "*EditorHScrollbar" style:highest "editor_hscrollbar" + diff --git a/gui/src/window-manager.cpp b/gui/src/window-manager.cpp new file mode 100644 index 000000000..6314aba94 --- /dev/null +++ b/gui/src/window-manager.cpp @@ -0,0 +1,48 @@ +/* + window-manager.cpp - Defines the global UI Manager class + + Copyright (C) Lumiera.org + 2008, Joel Holdsworth + + 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 "window-manager.hpp" + +namespace lumiera { +namespace gui { + + WindowManager::WindowManager() + { + + } + + bool WindowManager::set_theme(Glib::ustring path) + { + if(access(path.c_str(), R_OK)) + { + g_error("WindowManger: Unable to load rc file \"%s\"", path.c_str()); + return false; + } + + Gtk::RC rc(path); + gtk_rc_reset_styles (gtk_settings_get_default()); + + return true; + } + +} // namespace gui +} // namespace lumiera diff --git a/gui/src/window-manager.hpp b/gui/src/window-manager.hpp new file mode 100644 index 000000000..e2a9af8fa --- /dev/null +++ b/gui/src/window-manager.hpp @@ -0,0 +1,51 @@ +/* + window-manager.hpp - Defines the global UI Manager class + + Copyright (C) Lumiera.org + 2008, Joel Holdsworth + + 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. + +*/ +/** @file window-manager.hpp + ** This file contains the of global UI Manager class + ** user actions. + ** @see window-manager.cpp + ** @see gtk-lumiera.hpp + */ + +#include + +#ifndef WINDOW_MANAGER_HPP +#define WINDOW_MANAGER_HPP + +namespace lumiera { +namespace gui { + + class WindowManager + { + public: + WindowManager(); + + bool set_theme(Glib::ustring path); + + protected: + + }; + +} // namespace gui +} // namespace lumiera + +#endif // WINDOW_MANAGER_HPP From 7beaa3366d8e1126631f8aca3968f1f626a18bd8 Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Mon, 21 Apr 2008 22:28:34 +0100 Subject: [PATCH 027/110] Added menu items which will eventually toggle panels on and off --- gui/src/workspace/actions.cpp | 25 +++++++++++++++-- gui/src/workspace/actions.hpp | 39 ++++++++++++++------------ gui/src/workspace/workspace-window.cpp | 4 +++ 3 files changed, 47 insertions(+), 21 deletions(-) diff --git a/gui/src/workspace/actions.cpp b/gui/src/workspace/actions.cpp index 8adfcc141..005fd06a4 100644 --- a/gui/src/workspace/actions.cpp +++ b/gui/src/workspace/actions.cpp @@ -39,7 +39,7 @@ namespace workspace { { actionGroup = ActionGroup::create(); - // File menu: + // File menu actionGroup->add(Action::create("FileMenu", _("_File"))); actionGroup->add(Action::create("FileNewProject", Stock::NEW, _("_New Project...")), sigc::mem_fun(*this, &Actions::on_menu_file_new_project)); @@ -51,14 +51,21 @@ namespace workspace { actionGroup->add(Action::create("FileQuit", Stock::QUIT), sigc::mem_fun(*this, &Actions::on_menu_file_quit)); - // Edit menu: + // Edit menu actionGroup->add(Action::create("EditMenu", _("_Edit"))); actionGroup->add(Action::create("EditCopy", Stock::COPY), sigc::mem_fun(*this, &Actions::on_menu_others)); actionGroup->add(Action::create("EditPaste", Stock::PASTE), sigc::mem_fun(*this, &Actions::on_menu_others)); - // Help menu: + // View Menu + actionGroup->add(Action::create("ViewMenu", _("_View"))); + actionGroup->add(Action::create("ViewViewer", _("_Viewer")), + sigc::mem_fun(*this, &Actions::on_menu_view_viewer)); + actionGroup->add(Action::create("ViewTimeline", _("_Timeline")), + sigc::mem_fun(*this, &Actions::on_menu_view_timeline)); + + // Help Menu actionGroup->add(Action::create("HelpMenu", _("_Help")) ); actionGroup->add(Action::create("HelpAbout", Stock::ABOUT), sigc::mem_fun(*this, &Actions::on_menu_help_about) ); @@ -91,6 +98,18 @@ namespace workspace { workspaceWindow.hide(); // Closes the main window to stop the Gtk::Main::run(). } + void + Actions::on_menu_view_viewer() + { + //workspaceWindow.viewer_panel.show(); + } + + void + Actions::on_menu_view_timeline() + { + //workspaceWindow.timeline_panel.show(); + } + void Actions::on_menu_help_about() { diff --git a/gui/src/workspace/actions.hpp b/gui/src/workspace/actions.hpp index 27b744549..25d0f36db 100644 --- a/gui/src/workspace/actions.hpp +++ b/gui/src/workspace/actions.hpp @@ -44,29 +44,32 @@ class WorkspaceWindow; class Actions { private: - Actions(WorkspaceWindow &workspace_window); + Actions(WorkspaceWindow &workspace_window); - /** - * A reference to the MainWindow which owns - * this helper */ - WorkspaceWindow &workspaceWindow; + /** + * A reference to the MainWindow which owns + * this helper */ + WorkspaceWindow &workspaceWindow; - /* ===== Event Handlers ===== */ - void on_menu_file_new_project(); - void on_menu_file_open_project(); - void on_menu_file_render(); - void on_menu_file_quit(); + /* ===== Event Handlers ===== */ + void on_menu_file_new_project(); + void on_menu_file_open_project(); + void on_menu_file_render(); + void on_menu_file_quit(); - void on_menu_help_about(); - - // Temporary Junk - void on_menu_others(); + void on_menu_view_viewer(); + void on_menu_view_timeline(); - /* ===== Actions ===== */ - Glib::RefPtr actionGroup; - Glib::RefPtr m_refChoiceOne, m_refChoiceTwo; + void on_menu_help_about(); + + // Temporary Junk + void on_menu_others(); - friend class WorkspaceWindow; + /* ===== Actions ===== */ + Glib::RefPtr actionGroup; + Glib::RefPtr m_refChoiceOne, m_refChoiceTwo; + + friend class WorkspaceWindow; }; } // namespace workspace diff --git a/gui/src/workspace/workspace-window.cpp b/gui/src/workspace/workspace-window.cpp index d78eb5b5c..1256d0233 100644 --- a/gui/src/workspace/workspace-window.cpp +++ b/gui/src/workspace/workspace-window.cpp @@ -88,6 +88,10 @@ namespace workspace { " " " " " " + " " + " " + " " + " " " " " " " " From 19a97878ce2415f5c367a28b91e92f029362dcb3 Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Mon, 21 Apr 2008 22:59:35 +0100 Subject: [PATCH 028/110] Added the base of a preferences dialog --- gui/src/Makefile.am | 2 + gui/src/dialogs/preferences-dialog.cpp | 61 ++++++++++++++++++++++++++ gui/src/dialogs/preferences-dialog.hpp | 61 ++++++++++++++++++++++++++ gui/src/workspace/actions.cpp | 10 +++++ gui/src/workspace/actions.hpp | 2 + gui/src/workspace/workspace-window.cpp | 2 + 6 files changed, 138 insertions(+) create mode 100644 gui/src/dialogs/preferences-dialog.cpp create mode 100644 gui/src/dialogs/preferences-dialog.hpp diff --git a/gui/src/Makefile.am b/gui/src/Makefile.am index ac159ea65..2755fb0ae 100644 --- a/gui/src/Makefile.am +++ b/gui/src/Makefile.am @@ -23,6 +23,8 @@ gtk_lumiera_SOURCES = \ workspace/workspace-window.hpp \ dialogs/render.cpp \ dialogs/render.hpp \ + dialogs/preferences-dialog.cpp \ + dialogs/preferences-dialog.hpp \ panels/panel.cpp \ panels/panel.hpp \ panels/timeline-panel.cpp \ diff --git a/gui/src/dialogs/preferences-dialog.cpp b/gui/src/dialogs/preferences-dialog.cpp new file mode 100644 index 000000000..10f187c1c --- /dev/null +++ b/gui/src/dialogs/preferences-dialog.cpp @@ -0,0 +1,61 @@ +/* + preferences-dialog.cpp - Implementation of the application preferences dialog + + Copyright (C) Lumiera.org + 2008, Joel Holdsworth + + 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 "../gtk-lumiera.hpp" + +#include "preferences-dialog.hpp" + +using namespace Gtk; + +namespace lumiera { +namespace gui { +namespace dialogs { + + PreferencesDialog::PreferencesDialog(Window &parent) : + Dialog(_("Preferences"), parent, true) + { + VBox *v_box = get_vbox(); + g_assert(v_box != NULL); + + interfaceBox.pack_start(interfaceThemeCombo, PACK_SHRINK); + interfaceBox.set_spacing(4); + interfaceBox.set_border_width(5); + + notebook.append_page(interfaceBox, _("Interface")); + + v_box->pack_start(notebook); + + // Configure the dialog + v_box->set_spacing(4); + set_border_width(5); + set_resizable(false); + + // Configure the Cancel and OK buttons + add_button(Stock::CANCEL, RESPONSE_CANCEL); + add_button(Stock::OK, RESPONSE_OK); + + show_all_children(); + } + +} // namespace dialogs +} // namespace gui +} // namespace lumiera diff --git a/gui/src/dialogs/preferences-dialog.hpp b/gui/src/dialogs/preferences-dialog.hpp new file mode 100644 index 000000000..31ad169c7 --- /dev/null +++ b/gui/src/dialogs/preferences-dialog.hpp @@ -0,0 +1,61 @@ +/* + preferences-dialog.hpp - Definition of the application preferences dialog + + Copyright (C) Lumiera.org + 2008, Joel Holdsworth + + 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. + +*/ +/** @file render.hpp + ** This file contains the definition of the application preferences dialog + ** + */ + +#ifndef PREFERENCES_DIALOG_HPP +#define PREFERENCES_DIALOG_HPP + +#include + +using namespace Gtk; + +namespace lumiera { +namespace gui { +namespace dialogs { + + /** + * The defintion of render output dialog class + */ + class PreferencesDialog : public Dialog + { + public: + PreferencesDialog(Window &parent); + + protected: + + + protected: + Notebook notebook; + + VBox interfaceBox; + ComboBox interfaceThemeCombo; + + }; + +} // namespace dialogs +} // namespace gui +} // namespace lumiera + +#endif // PREFERENCES_DIALOG_HPP diff --git a/gui/src/workspace/actions.cpp b/gui/src/workspace/actions.cpp index 005fd06a4..6d69a8e6a 100644 --- a/gui/src/workspace/actions.cpp +++ b/gui/src/workspace/actions.cpp @@ -25,6 +25,7 @@ #include "workspace-window.hpp" #include "../dialogs/render.hpp" +#include "../dialogs/preferences-dialog.hpp" using namespace Gtk; using namespace Glib; @@ -57,6 +58,8 @@ namespace workspace { sigc::mem_fun(*this, &Actions::on_menu_others)); actionGroup->add(Action::create("EditPaste", Stock::PASTE), sigc::mem_fun(*this, &Actions::on_menu_others)); + actionGroup->add(Action::create("EditPreferences", Stock::PREFERENCES), + sigc::mem_fun(*this, &Actions::on_menu_edit_preferences)); // View Menu actionGroup->add(Action::create("ViewMenu", _("_View"))); @@ -98,6 +101,13 @@ namespace workspace { workspaceWindow.hide(); // Closes the main window to stop the Gtk::Main::run(). } + void + Actions::on_menu_edit_preferences() + { + dialogs::PreferencesDialog dialog(workspaceWindow); + dialog.run(); + } + void Actions::on_menu_view_viewer() { diff --git a/gui/src/workspace/actions.hpp b/gui/src/workspace/actions.hpp index 25d0f36db..5ec50c33a 100644 --- a/gui/src/workspace/actions.hpp +++ b/gui/src/workspace/actions.hpp @@ -57,6 +57,8 @@ class WorkspaceWindow; void on_menu_file_render(); void on_menu_file_quit(); + void on_menu_edit_preferences(); + void on_menu_view_viewer(); void on_menu_view_timeline(); diff --git a/gui/src/workspace/workspace-window.cpp b/gui/src/workspace/workspace-window.cpp index 1256d0233..66d74e905 100644 --- a/gui/src/workspace/workspace-window.cpp +++ b/gui/src/workspace/workspace-window.cpp @@ -87,6 +87,8 @@ namespace workspace { " " " " " " + " " + " " " " " " " " From 03bc0cd276960923d60d5e11a5f8f34af6b0c1f3 Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Fri, 2 May 2008 17:26:50 +0100 Subject: [PATCH 029/110] Relocated gui into the src folder --- gui/COPYING | 1 - gui/INSTALL | 1 - gui/po/POTFILES.in | 3 --- {gui => src/gui}/AUTHORS | 0 src/gui/COPYING | 1 + {gui => src/gui}/ChangeLog | 0 src/gui/INSTALL | 1 + {gui => src/gui}/Makefile.am | 0 {gui => src/gui}/NEWS | 0 {gui => src/gui}/README | 0 {gui => src/gui}/TODO.tasks | 0 {gui => src/gui}/autogen.sh | 0 {gui => src/gui}/configure.ac | 0 {gui => src/gui}/po/ChangeLog | 0 {gui => src/gui}/po/LINGUAS | 0 {gui => src/gui}/src/Makefile.am | 0 {gui => src/gui}/src/dialogs/preferences-dialog.cpp | 0 {gui => src/gui}/src/dialogs/preferences-dialog.hpp | 0 {gui => src/gui}/src/dialogs/render.cpp | 0 {gui => src/gui}/src/dialogs/render.hpp | 0 {gui => src/gui}/src/gtk-lumiera.cpp | 0 {gui => src/gui}/src/gtk-lumiera.hpp | 0 {gui => src/gui}/src/lumiera_ui.rc | 0 {gui => src/gui}/src/model/project.cpp | 0 {gui => src/gui}/src/model/project.hpp | 0 {gui => src/gui}/src/panels/assets-panel.cpp | 0 {gui => src/gui}/src/panels/assets-panel.hpp | 0 {gui => src/gui}/src/panels/panel.cpp | 0 {gui => src/gui}/src/panels/panel.hpp | 0 {gui => src/gui}/src/panels/timeline-panel.cpp | 0 {gui => src/gui}/src/panels/timeline-panel.hpp | 0 {gui => src/gui}/src/panels/viewer-panel.cpp | 0 {gui => src/gui}/src/panels/viewer-panel.hpp | 0 {gui => src/gui}/src/widgets/timeline-widget.cpp | 0 {gui => src/gui}/src/widgets/timeline-widget.hpp | 0 {gui => src/gui}/src/widgets/video-display-widget.cpp | 0 {gui => src/gui}/src/widgets/video-display-widget.hpp | 0 {gui => src/gui}/src/window-manager.cpp | 2 +- {gui => src/gui}/src/window-manager.hpp | 0 {gui => src/gui}/src/workspace/actions.cpp | 0 {gui => src/gui}/src/workspace/actions.hpp | 0 {gui => src/gui}/src/workspace/workspace-window.cpp | 0 {gui => src/gui}/src/workspace/workspace-window.hpp | 0 43 files changed, 3 insertions(+), 6 deletions(-) delete mode 120000 gui/COPYING delete mode 120000 gui/INSTALL delete mode 100644 gui/po/POTFILES.in rename {gui => src/gui}/AUTHORS (100%) create mode 120000 src/gui/COPYING rename {gui => src/gui}/ChangeLog (100%) create mode 120000 src/gui/INSTALL rename {gui => src/gui}/Makefile.am (100%) rename {gui => src/gui}/NEWS (100%) rename {gui => src/gui}/README (100%) rename {gui => src/gui}/TODO.tasks (100%) rename {gui => src/gui}/autogen.sh (100%) rename {gui => src/gui}/configure.ac (100%) rename {gui => src/gui}/po/ChangeLog (100%) rename {gui => src/gui}/po/LINGUAS (100%) rename {gui => src/gui}/src/Makefile.am (100%) rename {gui => src/gui}/src/dialogs/preferences-dialog.cpp (100%) rename {gui => src/gui}/src/dialogs/preferences-dialog.hpp (100%) rename {gui => src/gui}/src/dialogs/render.cpp (100%) rename {gui => src/gui}/src/dialogs/render.hpp (100%) rename {gui => src/gui}/src/gtk-lumiera.cpp (100%) rename {gui => src/gui}/src/gtk-lumiera.hpp (100%) rename {gui => src/gui}/src/lumiera_ui.rc (100%) rename {gui => src/gui}/src/model/project.cpp (100%) rename {gui => src/gui}/src/model/project.hpp (100%) rename {gui => src/gui}/src/panels/assets-panel.cpp (100%) rename {gui => src/gui}/src/panels/assets-panel.hpp (100%) rename {gui => src/gui}/src/panels/panel.cpp (100%) rename {gui => src/gui}/src/panels/panel.hpp (100%) rename {gui => src/gui}/src/panels/timeline-panel.cpp (100%) rename {gui => src/gui}/src/panels/timeline-panel.hpp (100%) rename {gui => src/gui}/src/panels/viewer-panel.cpp (100%) rename {gui => src/gui}/src/panels/viewer-panel.hpp (100%) rename {gui => src/gui}/src/widgets/timeline-widget.cpp (100%) rename {gui => src/gui}/src/widgets/timeline-widget.hpp (100%) rename {gui => src/gui}/src/widgets/video-display-widget.cpp (100%) rename {gui => src/gui}/src/widgets/video-display-widget.hpp (100%) rename {gui => src/gui}/src/window-manager.cpp (97%) rename {gui => src/gui}/src/window-manager.hpp (100%) rename {gui => src/gui}/src/workspace/actions.cpp (100%) rename {gui => src/gui}/src/workspace/actions.hpp (100%) rename {gui => src/gui}/src/workspace/workspace-window.cpp (100%) rename {gui => src/gui}/src/workspace/workspace-window.hpp (100%) diff --git a/gui/COPYING b/gui/COPYING deleted file mode 120000 index 0b6cbf81b..000000000 --- a/gui/COPYING +++ /dev/null @@ -1 +0,0 @@ -/usr/share/automake-1.10/COPYING \ No newline at end of file diff --git a/gui/INSTALL b/gui/INSTALL deleted file mode 120000 index 5bb6e7b7e..000000000 --- a/gui/INSTALL +++ /dev/null @@ -1 +0,0 @@ -/usr/share/automake-1.10/INSTALL \ No newline at end of file diff --git a/gui/po/POTFILES.in b/gui/po/POTFILES.in deleted file mode 100644 index a0b3c552e..000000000 --- a/gui/po/POTFILES.in +++ /dev/null @@ -1,3 +0,0 @@ -# List of source files containing translatable strings. - -src/main.c diff --git a/gui/AUTHORS b/src/gui/AUTHORS similarity index 100% rename from gui/AUTHORS rename to src/gui/AUTHORS diff --git a/src/gui/COPYING b/src/gui/COPYING new file mode 120000 index 000000000..71537690b --- /dev/null +++ b/src/gui/COPYING @@ -0,0 +1 @@ +/usr/share/automake-1.9/COPYING \ No newline at end of file diff --git a/gui/ChangeLog b/src/gui/ChangeLog similarity index 100% rename from gui/ChangeLog rename to src/gui/ChangeLog diff --git a/src/gui/INSTALL b/src/gui/INSTALL new file mode 120000 index 000000000..81fa6ffa4 --- /dev/null +++ b/src/gui/INSTALL @@ -0,0 +1 @@ +/usr/share/automake-1.9/INSTALL \ No newline at end of file diff --git a/gui/Makefile.am b/src/gui/Makefile.am similarity index 100% rename from gui/Makefile.am rename to src/gui/Makefile.am diff --git a/gui/NEWS b/src/gui/NEWS similarity index 100% rename from gui/NEWS rename to src/gui/NEWS diff --git a/gui/README b/src/gui/README similarity index 100% rename from gui/README rename to src/gui/README diff --git a/gui/TODO.tasks b/src/gui/TODO.tasks similarity index 100% rename from gui/TODO.tasks rename to src/gui/TODO.tasks diff --git a/gui/autogen.sh b/src/gui/autogen.sh similarity index 100% rename from gui/autogen.sh rename to src/gui/autogen.sh diff --git a/gui/configure.ac b/src/gui/configure.ac similarity index 100% rename from gui/configure.ac rename to src/gui/configure.ac diff --git a/gui/po/ChangeLog b/src/gui/po/ChangeLog similarity index 100% rename from gui/po/ChangeLog rename to src/gui/po/ChangeLog diff --git a/gui/po/LINGUAS b/src/gui/po/LINGUAS similarity index 100% rename from gui/po/LINGUAS rename to src/gui/po/LINGUAS diff --git a/gui/src/Makefile.am b/src/gui/src/Makefile.am similarity index 100% rename from gui/src/Makefile.am rename to src/gui/src/Makefile.am diff --git a/gui/src/dialogs/preferences-dialog.cpp b/src/gui/src/dialogs/preferences-dialog.cpp similarity index 100% rename from gui/src/dialogs/preferences-dialog.cpp rename to src/gui/src/dialogs/preferences-dialog.cpp diff --git a/gui/src/dialogs/preferences-dialog.hpp b/src/gui/src/dialogs/preferences-dialog.hpp similarity index 100% rename from gui/src/dialogs/preferences-dialog.hpp rename to src/gui/src/dialogs/preferences-dialog.hpp diff --git a/gui/src/dialogs/render.cpp b/src/gui/src/dialogs/render.cpp similarity index 100% rename from gui/src/dialogs/render.cpp rename to src/gui/src/dialogs/render.cpp diff --git a/gui/src/dialogs/render.hpp b/src/gui/src/dialogs/render.hpp similarity index 100% rename from gui/src/dialogs/render.hpp rename to src/gui/src/dialogs/render.hpp diff --git a/gui/src/gtk-lumiera.cpp b/src/gui/src/gtk-lumiera.cpp similarity index 100% rename from gui/src/gtk-lumiera.cpp rename to src/gui/src/gtk-lumiera.cpp diff --git a/gui/src/gtk-lumiera.hpp b/src/gui/src/gtk-lumiera.hpp similarity index 100% rename from gui/src/gtk-lumiera.hpp rename to src/gui/src/gtk-lumiera.hpp diff --git a/gui/src/lumiera_ui.rc b/src/gui/src/lumiera_ui.rc similarity index 100% rename from gui/src/lumiera_ui.rc rename to src/gui/src/lumiera_ui.rc diff --git a/gui/src/model/project.cpp b/src/gui/src/model/project.cpp similarity index 100% rename from gui/src/model/project.cpp rename to src/gui/src/model/project.cpp diff --git a/gui/src/model/project.hpp b/src/gui/src/model/project.hpp similarity index 100% rename from gui/src/model/project.hpp rename to src/gui/src/model/project.hpp diff --git a/gui/src/panels/assets-panel.cpp b/src/gui/src/panels/assets-panel.cpp similarity index 100% rename from gui/src/panels/assets-panel.cpp rename to src/gui/src/panels/assets-panel.cpp diff --git a/gui/src/panels/assets-panel.hpp b/src/gui/src/panels/assets-panel.hpp similarity index 100% rename from gui/src/panels/assets-panel.hpp rename to src/gui/src/panels/assets-panel.hpp diff --git a/gui/src/panels/panel.cpp b/src/gui/src/panels/panel.cpp similarity index 100% rename from gui/src/panels/panel.cpp rename to src/gui/src/panels/panel.cpp diff --git a/gui/src/panels/panel.hpp b/src/gui/src/panels/panel.hpp similarity index 100% rename from gui/src/panels/panel.hpp rename to src/gui/src/panels/panel.hpp diff --git a/gui/src/panels/timeline-panel.cpp b/src/gui/src/panels/timeline-panel.cpp similarity index 100% rename from gui/src/panels/timeline-panel.cpp rename to src/gui/src/panels/timeline-panel.cpp diff --git a/gui/src/panels/timeline-panel.hpp b/src/gui/src/panels/timeline-panel.hpp similarity index 100% rename from gui/src/panels/timeline-panel.hpp rename to src/gui/src/panels/timeline-panel.hpp diff --git a/gui/src/panels/viewer-panel.cpp b/src/gui/src/panels/viewer-panel.cpp similarity index 100% rename from gui/src/panels/viewer-panel.cpp rename to src/gui/src/panels/viewer-panel.cpp diff --git a/gui/src/panels/viewer-panel.hpp b/src/gui/src/panels/viewer-panel.hpp similarity index 100% rename from gui/src/panels/viewer-panel.hpp rename to src/gui/src/panels/viewer-panel.hpp diff --git a/gui/src/widgets/timeline-widget.cpp b/src/gui/src/widgets/timeline-widget.cpp similarity index 100% rename from gui/src/widgets/timeline-widget.cpp rename to src/gui/src/widgets/timeline-widget.cpp diff --git a/gui/src/widgets/timeline-widget.hpp b/src/gui/src/widgets/timeline-widget.hpp similarity index 100% rename from gui/src/widgets/timeline-widget.hpp rename to src/gui/src/widgets/timeline-widget.hpp diff --git a/gui/src/widgets/video-display-widget.cpp b/src/gui/src/widgets/video-display-widget.cpp similarity index 100% rename from gui/src/widgets/video-display-widget.cpp rename to src/gui/src/widgets/video-display-widget.cpp diff --git a/gui/src/widgets/video-display-widget.hpp b/src/gui/src/widgets/video-display-widget.hpp similarity index 100% rename from gui/src/widgets/video-display-widget.hpp rename to src/gui/src/widgets/video-display-widget.hpp diff --git a/gui/src/window-manager.cpp b/src/gui/src/window-manager.cpp similarity index 97% rename from gui/src/window-manager.cpp rename to src/gui/src/window-manager.cpp index 6314aba94..1bc8c1e16 100644 --- a/gui/src/window-manager.cpp +++ b/src/gui/src/window-manager.cpp @@ -38,7 +38,7 @@ namespace gui { return false; } - Gtk::RC rc(path); + gtk_rc_parse(path.c_str()); gtk_rc_reset_styles (gtk_settings_get_default()); return true; diff --git a/gui/src/window-manager.hpp b/src/gui/src/window-manager.hpp similarity index 100% rename from gui/src/window-manager.hpp rename to src/gui/src/window-manager.hpp diff --git a/gui/src/workspace/actions.cpp b/src/gui/src/workspace/actions.cpp similarity index 100% rename from gui/src/workspace/actions.cpp rename to src/gui/src/workspace/actions.cpp diff --git a/gui/src/workspace/actions.hpp b/src/gui/src/workspace/actions.hpp similarity index 100% rename from gui/src/workspace/actions.hpp rename to src/gui/src/workspace/actions.hpp diff --git a/gui/src/workspace/workspace-window.cpp b/src/gui/src/workspace/workspace-window.cpp similarity index 100% rename from gui/src/workspace/workspace-window.cpp rename to src/gui/src/workspace/workspace-window.cpp diff --git a/gui/src/workspace/workspace-window.hpp b/src/gui/src/workspace/workspace-window.hpp similarity index 100% rename from gui/src/workspace/workspace-window.hpp rename to src/gui/src/workspace/workspace-window.hpp From 130da1ec7705ce608d393c8b5b952b97195891ff Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Mon, 5 May 2008 22:21:58 +0100 Subject: [PATCH 030/110] Layed the foundation of a --- src/gui/AUTHORS | 0 src/gui/COPYING | 1 - src/gui/ChangeLog | 0 src/gui/INSTALL | 1 - src/gui/Makefile.am | 9 +- src/gui/NEWS | 0 src/gui/README | 0 src/gui/TODO.tasks | 6 - src/gui/autogen.sh | 4 +- src/gui/configure.ac | 41 +++- src/gui/src/Makefile.am | 6 +- src/gui/src/output/displayer.cpp | 65 ++++++ src/gui/src/output/displayer.hpp | 107 ++++++++++ src/gui/src/output/xvdisplayer.cpp | 214 +++++++++++++++++++ src/gui/src/output/xvdisplayer.hpp | 68 ++++++ src/gui/src/widgets/video-display-widget.hpp | 6 +- src/gui/src/window-manager.hpp | 2 +- 17 files changed, 505 insertions(+), 25 deletions(-) delete mode 100644 src/gui/AUTHORS delete mode 120000 src/gui/COPYING delete mode 100644 src/gui/ChangeLog delete mode 120000 src/gui/INSTALL delete mode 100644 src/gui/NEWS delete mode 100644 src/gui/README delete mode 100644 src/gui/TODO.tasks create mode 100644 src/gui/src/output/displayer.cpp create mode 100644 src/gui/src/output/displayer.hpp create mode 100644 src/gui/src/output/xvdisplayer.cpp create mode 100644 src/gui/src/output/xvdisplayer.hpp diff --git a/src/gui/AUTHORS b/src/gui/AUTHORS deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/gui/COPYING b/src/gui/COPYING deleted file mode 120000 index 71537690b..000000000 --- a/src/gui/COPYING +++ /dev/null @@ -1 +0,0 @@ -/usr/share/automake-1.9/COPYING \ No newline at end of file diff --git a/src/gui/ChangeLog b/src/gui/ChangeLog deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/gui/INSTALL b/src/gui/INSTALL deleted file mode 120000 index 81fa6ffa4..000000000 --- a/src/gui/INSTALL +++ /dev/null @@ -1 +0,0 @@ -/usr/share/automake-1.9/INSTALL \ No newline at end of file diff --git a/src/gui/Makefile.am b/src/gui/Makefile.am index 329e83f38..50af375e8 100644 --- a/src/gui/Makefile.am +++ b/src/gui/Makefile.am @@ -1,16 +1,9 @@ ## Process this file with automake to produce Makefile.in -## Created by Anjuta SUBDIRS = src po gtk_lumieradocdir = ${prefix}/doc/gtk-lumiera -gtk_lumieradoc_DATA = \ - README\ - COPYING\ - AUTHORS\ - ChangeLog\ - INSTALL\ - NEWS +gtk_lumieradoc_DATA = EXTRA_DIST = $(gtk_lumieradoc_DATA) diff --git a/src/gui/NEWS b/src/gui/NEWS deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/gui/README b/src/gui/README deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/gui/TODO.tasks b/src/gui/TODO.tasks deleted file mode 100644 index d1fa282d9..000000000 --- a/src/gui/TODO.tasks +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/src/gui/autogen.sh b/src/gui/autogen.sh index 9ab346a30..5e54fc413 100755 --- a/src/gui/autogen.sh +++ b/src/gui/autogen.sh @@ -140,8 +140,8 @@ do echo "Running autoheader..." autoheader fi - echo "Running automake --gnu $am_opt ..." - automake --add-missing --gnu $am_opt + echo "Running automake --foreign $am_opt ..." + automake --add-missing --foreign $am_opt echo "Running autoconf ..." autoconf ) diff --git a/src/gui/configure.ac b/src/gui/configure.ac index fbc00ed01..2e3a7cd21 100644 --- a/src/gui/configure.ac +++ b/src/gui/configure.ac @@ -1,5 +1,4 @@ dnl Process this file with autoconf to produce a configure script. -dnl Created by Anjuta application wizard. AC_INIT(gtk-lumiera, 0.1) @@ -29,14 +28,48 @@ IT_PROG_INTLTOOL([0.35.0]) AM_PROG_LIBTOOL +# ###################################################################### +# Checks for X11 and XVideo +# ###################################################################### +AC_PATH_X +AC_PATH_XTRA +# CFLAGS="$CFLAGS $X_CFLAGS" +LIBS="$LIBS $X_PRE_LIBS $X_LIBS $X_EXTRA_LIBS" +AC_CHECK_HEADERS([X11/Xlib.h X11/Xutil.h],[], + [AC_MSG_ERROR([Xlib.h or Xutil.h not found install xdevel])]) + +# OK, this is confusing. The old tests test for the existence of a number +# of header files, and add -lXv to the linker flags if they are there. +# However, if they are _not_ there, only a warning is issued, but +# src/displayer.h includes these unconditionally. +# I conclude that -lXv _is_ required. If not, src/displayer.h should be edited, +# I think. +# This test requires libXv and, therefore, libXext + +AC_CHECK_HEADERS([sys/ipc.h sys/shm.h],, + [AC_MSG_ERROR([Required header not found. Please check that it is installed])] +) +AC_CHECK_HEADERS([X11/extensions/Xvlib.h X11/extensions/XShm.h],, + [AC_MSG_ERROR([Required xvideo (Xv) extension to X not found. Please check that it is installed.])], + [#include ] +) + +AC_CHECK_LIB(Xext, XInitExtension, , + [AC_MSG_ERROR([Could not link with libXext. Check that you have libXext installed])], -lX11 +) +AC_CHECK_LIB(Xv, XvQueryAdaptors, , + [AC_MSG_ERROR([Could not link with libXv. Check that you have libXv installed])] +) + +# ###################################################################### +# Checks for GTK stuff +# ###################################################################### PKG_CHECK_MODULES(GTK_LUMIERA, [gtkmm-2.4 >= 2.8 gdl-1.0 >= 0.6.1 cairomm-1.0 >= 0.6.0]) + AC_SUBST(GTK_LUMIERA_CFLAGS) AC_SUBST(GTK_LUMIERA_LIBS) - - - AC_OUTPUT([ Makefile src/Makefile diff --git a/src/gui/src/Makefile.am b/src/gui/src/Makefile.am index 2755fb0ae..29e6a6cfb 100644 --- a/src/gui/src/Makefile.am +++ b/src/gui/src/Makefile.am @@ -38,7 +38,11 @@ gtk_lumiera_SOURCES = \ widgets/timeline-widget.cpp \ widgets/timeline-widget.hpp \ model/project.cpp \ - model/project.hpp + model/project.hpp \ + output/displayer.cpp \ + output/displayer.hpp \ + output/xvdisplayer.cpp \ + output/xvdisplayer.hpp gtk_lumiera_LDFLAGS = diff --git a/src/gui/src/output/displayer.cpp b/src/gui/src/output/displayer.cpp new file mode 100644 index 000000000..0570d5a19 --- /dev/null +++ b/src/gui/src/output/displayer.cpp @@ -0,0 +1,65 @@ +/* + displayer.cpp - Implements the base class for displaying video + + Copyright (C) Lumiera.org + 2000, Arne Schirmacher + 2001-2007, Dan Dennedy + 2008, Joel Holdsworth + + 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 "displayer.hpp" + +namespace lumiera { +namespace gui { +namespace output { + + + + DisplayerInput Displayer::format() + { + return DISPLAY_NONE; + } + + int Displayer::preferredWidth() + { + return imageWidth; + } + + int Displayer::preferredHeight() + { + return imageHeight; + } + + void Displayer::put( void *image, int width, int height ) + { + if ( width == preferredWidth() && height == preferredHeight() ) + { + put( image ); + } + else + { + reformat( format(), format(), image, width, height ); + put( pixels ); + } + } + + + +} // namespace output +} // namespace gui +} // namespace lumiera diff --git a/src/gui/src/output/displayer.hpp b/src/gui/src/output/displayer.hpp new file mode 100644 index 000000000..a04eca784 --- /dev/null +++ b/src/gui/src/output/displayer.hpp @@ -0,0 +1,107 @@ +/* + displayer.hpp - Defines the base class for displaying video + + Copyright (C) Lumiera.org + 2000, Arne Schirmacher + 2001-2007, Dan Dennedy + 2008, Joel Holdsworth + + 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. + +*/ +/** @file displayer.hpp + ** This file contains the defintion of Displayer; the base class + ** of all video display implementations + ** @see displayer.cpp + */ + +#ifndef DISPLAYER_HPP +#define DISPLAYER_HPP + +namespace lumiera { +namespace gui { +namespace output { + + /** Supported Displayer formats + */ + + typedef enum { + DISPLAY_NONE, + DISPLAY_YUV, + DISPLAY_RGB, + DISPLAY_BGR, + DISPLAY_BGR0, + DISPLAY_RGB16 + } + DisplayerInput; + + /** A Displayer is a class which is responsible for rendering an image in some + way (ie: Xvideo, GDK, OpenGL etc). + + All Displayer classes must extend the Displayer class and minimally rewrite: + + + usable() - to indicate if the object can be used, + + format() - to indicate what type of input the put method expects + + put( void * ) - deal with an image of the expected type and size + + By default, all images will be delivered to the put method in a resolution + of IMG_WIDTH * IMG_HEIGHT. If another size is required, then the rewrite + the methods: + + + preferredWidth + + preferredHeight + + If the widget being written to doesn't need a fixed size, then rewrite + the two other put methods as required. + */ + class Displayer + { + public: + + /** Indicates the format required by the abstract put method. + */ + virtual DisplayerInput format(); + + /** Expected width of input to put. + */ + virtual int preferredWidth(); + + /** Expected height of input to put. + */ + virtual int preferredHeight(); + + /** Put an image of a given width and height with the expected input + format (as indicated by the format method). + + \param image image of correct format and specified width/height + \param width width of image + \param height height of image + */ + virtual void put( void *image, int width, int height ); + + virtual bool usable(); + + protected: + int imageWidth; + int imageHeight; + + virtual void put( void * ) = 0; + }; + +} // namespace output +} // namespace gui +} // namespace lumiera + +#endif // DISPLAYER_HPP diff --git a/src/gui/src/output/xvdisplayer.cpp b/src/gui/src/output/xvdisplayer.cpp new file mode 100644 index 000000000..ac15c86d1 --- /dev/null +++ b/src/gui/src/output/xvdisplayer.cpp @@ -0,0 +1,214 @@ +/* + displayer.cpp - Implements the base class for displaying video + + Copyright (C) Lumiera.org + 2000, Arne Schirmacher + 2001-2007, Dan Dennedy + 2008, Joel Holdsworth + + 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 "xvdisplayer.hpp" + +namespace lumiera { +namespace gui { +namespace output { + +XvDisplayer::XvDisplayer( GtkWidget *drawingarea, int width, int height, bool isPAL, bool isWidescreen ) : + xvImage( NULL ) +{ + cerr << ">> Trying XVideo at " << width << "x" << height << endl; + + this->drawingarea = drawingarea; + img_width = width; + img_height = height; + this->isPAL = isPAL; + this->isWidescreen = isWidescreen; + + shmInfo.shmaddr = NULL; + gotPort = false; + + window = GDK_WINDOW_XID( drawingarea->window ); + display = GDK_WINDOW_XDISPLAY( drawingarea->window ); + + unsigned int count; + XvAdaptorInfo *adaptorInfo; + + if ( XvQueryAdaptors( display, window, &count, &adaptorInfo ) == Success ) + { + + cerr << ">>> XvQueryAdaptors count: " << count << endl; + for ( unsigned int n = 0; gotPort == false && n < count; ++n ) + { + // Diagnostics + cerr << ">>> Xv: " << adaptorInfo[ n ].name + << ": ports " << adaptorInfo[ n ].base_id + << " - " << adaptorInfo[ n ].base_id + + adaptorInfo[ n ].num_ports - 1 + << endl; + + for ( port = adaptorInfo[ n ].base_id; + port < adaptorInfo[ n ].base_id + adaptorInfo[ n ].num_ports; + port ++ ) + { + if ( XvGrabPort( display, port, CurrentTime ) == 0 ) + { + + int formats; + XvImageFormatValues *list; + + list = XvListImageFormats( display, port, &formats ); + + cerr << ">>> formats supported: " << formats << endl; + + for ( int i = 0; i < formats; i ++ ) + { + fprintf( stderr, ">>> 0x%x (%c%c%c%c) %s\n", + list[ i ].id, + ( list[ i ].id ) & 0xff, + ( list[ i ].id >> 8 ) & 0xff, + ( list[ i ].id >> 16 ) & 0xff, + ( list[ i ].id >> 24 ) & 0xff, + ( list[ i ].format == XvPacked ) ? "packed" : "planar" ); + if ( list[ i ].id == 0x32595559 && !gotPort ) + gotPort = true; + } + + if ( !gotPort ) + { + XvUngrabPort( display, port, CurrentTime ); + } + else + { + grabbedPort = port; + break; + } + } + } + } + + if ( gotPort ) + { + int num; + unsigned int unum; + XvEncodingInfo *enc; + + XvQueryEncodings( display, grabbedPort, &unum, &enc ); + for ( unsigned int index = 0; index < unum; index ++ ) + { + fprintf( stderr, ">>> %d: %s, %ldx%ld rate = %d/%d\n", index, enc->name, + enc->width, enc->height, enc->rate.numerator, + enc->rate.denominator ); + } + + XvAttribute *xvattr = XvQueryPortAttributes( display, port, &num ); + for ( int k = 0; k < num; k++ ) + { + if ( xvattr[k].flags & XvSettable ) + { + if ( strcmp( xvattr[k].name, "XV_AUTOPAINT_COLORKEY") == 0 ) + { + Atom val_atom = XInternAtom( display, xvattr[k].name, False ); + if ( XvSetPortAttribute( display, port, val_atom, 1 ) != Success ) + fprintf(stderr, "Couldn't set Xv attribute %s\n", xvattr[k].name); + } + else if ( strcmp( xvattr[k].name, "XV_COLORKEY") == 0 ) + { + Atom val_atom = XInternAtom( display, xvattr[k].name, False ); + if ( XvSetPortAttribute( display, port, val_atom, 0x010102 ) != Success ) + fprintf(stderr, "Couldn't set Xv attribute %s\n", xvattr[k].name); + } + } + } + } + + if ( gotPort ) + { + gc = XCreateGC( display, window, 0, &values ); + + xvImage = ( XvImage * ) XvShmCreateImage( display, port, 0x32595559, 0, width, height, &shmInfo ); + + shmInfo.shmid = shmget( IPC_PRIVATE, xvImage->data_size, IPC_CREAT | 0777 ); + if (shmInfo.shmid < 0) { + perror("shmget"); + gotPort = false; + } else { + shmInfo.shmaddr = ( char * ) shmat( shmInfo.shmid, 0, 0 ); + xvImage->data = shmInfo.shmaddr; + shmInfo.readOnly = 0; + if ( !XShmAttach( gdk_display, &shmInfo ) ) + { + gotPort = false; + } + XSync( display, false ); + shmctl( shmInfo.shmid, IPC_RMID, 0 ); +#if 0 + xvImage = ( XvImage * ) XvCreateImage( display, port, 0x32595559, pix, width , height ); +#endif + } + } + } + else + { + gotPort = false; + } +} + +XvDisplayer::~XvDisplayer() +{ + cerr << ">> Destroying XV Displayer" << endl; + + if ( gotPort ) + { + XvUngrabPort( display, grabbedPort, CurrentTime ); + } + + if ( xvImage != NULL ) + XvStopVideo( display, port, window ); + + if ( shmInfo.shmaddr != NULL ) + { + XShmDetach( display, &shmInfo ); + shmctl( shmInfo.shmid, IPC_RMID, 0 ); + shmdt( shmInfo.shmaddr ); + } + if ( xvImage != NULL ) + XFree( xvImage ); +} + +bool XvDisplayer::usable() +{ + return gotPort; +} + + void XvDisplayer::put( void *image ) + { + AspectRatioCalculator calc( ( ( GtkWidget * ) drawingarea ) ->allocation.width, + ( ( GtkWidget * ) drawingarea ) ->allocation.height, + this->preferredWidth(), this->preferredHeight(), + isPAL, isWidescreen ); + + memcpy( xvImage->data, image, xvImage->data_size ); + + XvShmPutImage( display, port, window, gc, xvImage, + 0, 0, this->preferredWidth(), this->preferredHeight(), + calc.x, calc.y, calc.width, calc.height, false ); + } + +} // namespace output +} // namespace gui +} // namespace lumiera diff --git a/src/gui/src/output/xvdisplayer.hpp b/src/gui/src/output/xvdisplayer.hpp new file mode 100644 index 000000000..77cd27459 --- /dev/null +++ b/src/gui/src/output/xvdisplayer.hpp @@ -0,0 +1,68 @@ +/* + xcdisplayer.hpp - Defines the base class for XVideo display + + Copyright (C) Lumiera.org + 2000, Arne Schirmacher + 2001-2007, Dan Dennedy + 2008, Joel Holdsworth + + 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. + +*/ +/** @file xvdisplayer.hpp + ** This file contains the definition of XvDisplayer, the XVideo + ** video output implementation + ** @see xvdisplayer.cpp + */ + +#include "displayer.hpp" + +#include +#include +#include + +#ifndef XVDISPLAYER_HPP +#define XVDISPLAYER_HPP + +namespace lumiera { +namespace gui { +namespace output { + + class XvDisplayer + { + public: + XvDisplayer(); + ~XvDisplayer(); + + protected: + void put( void *image ); + + private: + bool canuse; + int depth; + GtkWidget *drawingarea; + Display *display; + Window window; + GC gc; + XImage *xImage; + XGCValues values; + XShmSegmentInfo shmInfo; + }; + +} // namespace output +} // namespace gui +} // namespace lumiera + +#endif // XVDISPLAYER_HPP diff --git a/src/gui/src/widgets/video-display-widget.hpp b/src/gui/src/widgets/video-display-widget.hpp index d082e8a2f..b7ef32200 100644 --- a/src/gui/src/widgets/video-display-widget.hpp +++ b/src/gui/src/widgets/video-display-widget.hpp @@ -38,9 +38,13 @@ namespace widgets { VideoDisplayWidget(); /* ===== Overrides ===== */ - protected: + private: virtual void on_realize(); virtual bool on_expose_event(GdkEventExpose* event); + + /* ===== Internals ===== */ + private: + }; } // namespace widgets diff --git a/src/gui/src/window-manager.hpp b/src/gui/src/window-manager.hpp index e2a9af8fa..f41d9945c 100644 --- a/src/gui/src/window-manager.hpp +++ b/src/gui/src/window-manager.hpp @@ -20,7 +20,7 @@ */ /** @file window-manager.hpp - ** This file contains the of global UI Manager class + ** This file contains the defintion of global UI Manager class ** user actions. ** @see window-manager.cpp ** @see gtk-lumiera.hpp From f1fdfdf94abd2b185ada65f01b939af190ed5a10 Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Thu, 8 May 2008 20:56:55 +0100 Subject: [PATCH 031/110] Added XVideo code --- src/gui/src/Makefile.am | 2 + src/gui/src/output/displayer.cpp | 62 ++-- src/gui/src/output/displayer.hpp | 21 +- src/gui/src/output/xvdisplayer.cpp | 313 ++++++++++--------- src/gui/src/output/xvdisplayer.hpp | 30 +- src/gui/src/widgets/video-display-widget.cpp | 114 +++++-- src/gui/src/widgets/video-display-widget.hpp | 13 + 7 files changed, 340 insertions(+), 215 deletions(-) diff --git a/src/gui/src/Makefile.am b/src/gui/src/Makefile.am index 29e6a6cfb..0bee8fedd 100644 --- a/src/gui/src/Makefile.am +++ b/src/gui/src/Makefile.am @@ -39,6 +39,8 @@ gtk_lumiera_SOURCES = \ widgets/timeline-widget.hpp \ model/project.cpp \ model/project.hpp \ + output/aspectratiocalculator.cpp \ + output/aspectratiocalculator.hpp \ output/displayer.cpp \ output/displayer.hpp \ output/xvdisplayer.cpp \ diff --git a/src/gui/src/output/displayer.cpp b/src/gui/src/output/displayer.cpp index 0570d5a19..359d0aaa3 100644 --- a/src/gui/src/output/displayer.cpp +++ b/src/gui/src/output/displayer.cpp @@ -28,37 +28,45 @@ namespace lumiera { namespace gui { namespace output { +bool +Displayer::usable() +{ + return false; +} +DisplayerInput +Displayer::format() +{ + return DISPLAY_NONE; +} - DisplayerInput Displayer::format() - { - return DISPLAY_NONE; - } - - int Displayer::preferredWidth() - { - return imageWidth; - } - - int Displayer::preferredHeight() - { - return imageHeight; - } - - void Displayer::put( void *image, int width, int height ) - { - if ( width == preferredWidth() && height == preferredHeight() ) - { - put( image ); - } - else - { - reformat( format(), format(), image, width, height ); - put( pixels ); - } - } +int +Displayer::preferredWidth() +{ + return imageWidth; +} +int +Displayer::preferredHeight() +{ + return imageHeight; +} +void +Displayer::CalculateVideoLayout( + int widget_width, int widget_height, + int image_width, int image_height, + int &video_x, int &video_y, int &video_width, int &video_height ) +{ + double ratio_width = ( double ) widget_width / ( double ) image_width; + double ratio_height = ( double ) widget_height / ( double ) image_height; + double ratio_constant = ratio_height < ratio_width ? + ratio_height : ratio_width; + video_width = ( int ) ( image_width * ratio_constant + 0.5 ); + video_height = ( int ) ( image_height * ratio_constant + 0.5 ); + video_x = ( widget_width - video_width ) / 2; + video_y = ( widget_height - video_height ) / 2; +} } // namespace output } // namespace gui diff --git a/src/gui/src/output/displayer.hpp b/src/gui/src/output/displayer.hpp index a04eca784..2d568607e 100644 --- a/src/gui/src/output/displayer.hpp +++ b/src/gui/src/output/displayer.hpp @@ -34,6 +34,9 @@ namespace lumiera { namespace gui { namespace output { +#define MAX_WIDTH 720 +#define MAX_HEIGHT 576 + /** Supported Displayer formats */ @@ -70,6 +73,11 @@ namespace output { { public: + /** Indicates if an object can be used to render images on the running + system. + */ + virtual bool usable(); + /** Indicates the format required by the abstract put method. */ virtual DisplayerInput format(); @@ -86,18 +94,19 @@ namespace output { format (as indicated by the format method). \param image image of correct format and specified width/height - \param width width of image - \param height height of image */ - virtual void put( void *image, int width, int height ); + virtual void put( void * ) = 0; - virtual bool usable(); + protected: + + static void CalculateVideoLayout( + int widget_width, int widget_height, + int image_width, int image_height, + int &video_x, int &video_y, int &video_width, int &video_height ); protected: int imageWidth; int imageHeight; - - virtual void put( void * ) = 0; }; } // namespace output diff --git a/src/gui/src/output/xvdisplayer.cpp b/src/gui/src/output/xvdisplayer.cpp index ac15c86d1..8fe96d03f 100644 --- a/src/gui/src/output/xvdisplayer.cpp +++ b/src/gui/src/output/xvdisplayer.cpp @@ -22,192 +22,211 @@ * *****************************************************/ +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +using std::cerr; +using std::endl; + #include "xvdisplayer.hpp" namespace lumiera { namespace gui { namespace output { -XvDisplayer::XvDisplayer( GtkWidget *drawingarea, int width, int height, bool isPAL, bool isWidescreen ) : - xvImage( NULL ) +XvDisplayer::XvDisplayer( Gtk::Widget *drawingarea, int width, int height ) : + xvImage( NULL ) { - cerr << ">> Trying XVideo at " << width << "x" << height << endl; + cerr << ">> Trying XVideo at " << width << "x" << height << endl; - this->drawingarea = drawingarea; - img_width = width; - img_height = height; - this->isPAL = isPAL; - this->isWidescreen = isWidescreen; + this->drawingarea = drawingarea; + imageWidth = width; + imageHeight = height; - shmInfo.shmaddr = NULL; - gotPort = false; + shmInfo.shmaddr = NULL; + gotPort = false; - window = GDK_WINDOW_XID( drawingarea->window ); - display = GDK_WINDOW_XDISPLAY( drawingarea->window ); + Glib::RefPtr area_window = drawingarea->get_window(); - unsigned int count; - XvAdaptorInfo *adaptorInfo; + window = gdk_x11_drawable_get_xid( area_window->gobj() ); + display = gdk_x11_drawable_get_xdisplay( area_window->gobj() ); - if ( XvQueryAdaptors( display, window, &count, &adaptorInfo ) == Success ) - { + unsigned int count; + XvAdaptorInfo *adaptorInfo; - cerr << ">>> XvQueryAdaptors count: " << count << endl; - for ( unsigned int n = 0; gotPort == false && n < count; ++n ) - { - // Diagnostics - cerr << ">>> Xv: " << adaptorInfo[ n ].name - << ": ports " << adaptorInfo[ n ].base_id - << " - " << adaptorInfo[ n ].base_id + - adaptorInfo[ n ].num_ports - 1 - << endl; + if ( XvQueryAdaptors( display, window, &count, &adaptorInfo ) == Success ) + { - for ( port = adaptorInfo[ n ].base_id; - port < adaptorInfo[ n ].base_id + adaptorInfo[ n ].num_ports; - port ++ ) - { - if ( XvGrabPort( display, port, CurrentTime ) == 0 ) - { + cerr << ">>> XvQueryAdaptors count: " << count << endl; + for ( unsigned int n = 0; gotPort == false && n < count; ++n ) + { + // Diagnostics + cerr << ">>> Xv: " << adaptorInfo[ n ].name + << ": ports " << adaptorInfo[ n ].base_id + << " - " << adaptorInfo[ n ].base_id + + adaptorInfo[ n ].num_ports - 1 + << endl; - int formats; - XvImageFormatValues *list; + for ( port = adaptorInfo[ n ].base_id; + port < adaptorInfo[ n ].base_id + adaptorInfo[ n ].num_ports; + port ++ ) + { + if ( XvGrabPort( display, port, CurrentTime ) == Success ) + { + g_message("XvGrabPort == 0"); + int formats; + XvImageFormatValues *list; - list = XvListImageFormats( display, port, &formats ); + list = XvListImageFormats( display, port, &formats ); - cerr << ">>> formats supported: " << formats << endl; + cerr << ">>> formats supported: " << formats << endl; - for ( int i = 0; i < formats; i ++ ) - { - fprintf( stderr, ">>> 0x%x (%c%c%c%c) %s\n", - list[ i ].id, - ( list[ i ].id ) & 0xff, - ( list[ i ].id >> 8 ) & 0xff, - ( list[ i ].id >> 16 ) & 0xff, - ( list[ i ].id >> 24 ) & 0xff, - ( list[ i ].format == XvPacked ) ? "packed" : "planar" ); - if ( list[ i ].id == 0x32595559 && !gotPort ) - gotPort = true; - } + for ( int i = 0; i < formats; i ++ ) + { + fprintf( stderr, ">>> 0x%x (%c%c%c%c) %s\n", + list[ i ].id, + ( list[ i ].id ) & 0xff, + ( list[ i ].id >> 8 ) & 0xff, + ( list[ i ].id >> 16 ) & 0xff, + ( list[ i ].id >> 24 ) & 0xff, + ( list[ i ].format == XvPacked ) ? "packed" : "planar" ); + if ( list[ i ].id == 0x32595559 && !gotPort ) + gotPort = true; + } - if ( !gotPort ) - { - XvUngrabPort( display, port, CurrentTime ); - } - else - { - grabbedPort = port; - break; - } - } - } - } + if ( !gotPort ) + { + XvUngrabPort( display, port, CurrentTime ); + } + else + { + grabbedPort = port; + break; + } + } + } + } - if ( gotPort ) - { - int num; - unsigned int unum; - XvEncodingInfo *enc; - - XvQueryEncodings( display, grabbedPort, &unum, &enc ); - for ( unsigned int index = 0; index < unum; index ++ ) - { - fprintf( stderr, ">>> %d: %s, %ldx%ld rate = %d/%d\n", index, enc->name, - enc->width, enc->height, enc->rate.numerator, - enc->rate.denominator ); - } - - XvAttribute *xvattr = XvQueryPortAttributes( display, port, &num ); - for ( int k = 0; k < num; k++ ) - { - if ( xvattr[k].flags & XvSettable ) - { - if ( strcmp( xvattr[k].name, "XV_AUTOPAINT_COLORKEY") == 0 ) - { - Atom val_atom = XInternAtom( display, xvattr[k].name, False ); - if ( XvSetPortAttribute( display, port, val_atom, 1 ) != Success ) - fprintf(stderr, "Couldn't set Xv attribute %s\n", xvattr[k].name); - } - else if ( strcmp( xvattr[k].name, "XV_COLORKEY") == 0 ) - { - Atom val_atom = XInternAtom( display, xvattr[k].name, False ); - if ( XvSetPortAttribute( display, port, val_atom, 0x010102 ) != Success ) - fprintf(stderr, "Couldn't set Xv attribute %s\n", xvattr[k].name); - } - } - } - } + if ( gotPort ) + { + int num; + unsigned int unum; + XvEncodingInfo *enc; + + XvQueryEncodings( display, grabbedPort, &unum, &enc ); + for ( unsigned int index = 0; index < unum; index ++ ) + { + fprintf( stderr, ">>> %d: %s, %ldx%ld rate = %d/%d\n", index, enc->name, + enc->width, enc->height, enc->rate.numerator, + enc->rate.denominator ); + } + + XvAttribute *xvattr = XvQueryPortAttributes( display, port, &num ); + for ( int k = 0; k < num; k++ ) + { + if ( xvattr[k].flags & XvSettable ) + { + if ( strcmp( xvattr[k].name, "XV_AUTOPAINT_COLORKEY") == 0 ) + { + Atom val_atom = XInternAtom( display, xvattr[k].name, False ); + if ( XvSetPortAttribute( display, port, val_atom, 1 ) != Success ) + fprintf(stderr, "Couldn't set Xv attribute %s\n", xvattr[k].name); + } + else if ( strcmp( xvattr[k].name, "XV_COLORKEY") == 0 ) + { + Atom val_atom = XInternAtom( display, xvattr[k].name, False ); + if ( XvSetPortAttribute( display, port, val_atom, 0x010102 ) != Success ) + fprintf(stderr, "Couldn't set Xv attribute %s\n", xvattr[k].name); + } + } + } + } - if ( gotPort ) - { - gc = XCreateGC( display, window, 0, &values ); + if ( gotPort ) + { + gc = XCreateGC( display, window, 0, &values ); - xvImage = ( XvImage * ) XvShmCreateImage( display, port, 0x32595559, 0, width, height, &shmInfo ); + xvImage = ( XvImage * ) XvShmCreateImage( display, port, 0x32595559, 0, width, height, &shmInfo ); - shmInfo.shmid = shmget( IPC_PRIVATE, xvImage->data_size, IPC_CREAT | 0777 ); - if (shmInfo.shmid < 0) { - perror("shmget"); - gotPort = false; - } else { - shmInfo.shmaddr = ( char * ) shmat( shmInfo.shmid, 0, 0 ); - xvImage->data = shmInfo.shmaddr; - shmInfo.readOnly = 0; - if ( !XShmAttach( gdk_display, &shmInfo ) ) - { - gotPort = false; - } - XSync( display, false ); - shmctl( shmInfo.shmid, IPC_RMID, 0 ); + shmInfo.shmid = shmget( IPC_PRIVATE, xvImage->data_size, IPC_CREAT | 0777 ); + if (shmInfo.shmid < 0) { + perror("shmget"); + gotPort = false; + } else { + shmInfo.shmaddr = ( char * ) shmat( shmInfo.shmid, 0, 0 ); + xvImage->data = shmInfo.shmaddr; + shmInfo.readOnly = 0; + if ( !XShmAttach( gdk_display, &shmInfo ) ) + { + gotPort = false; + } + XSync( display, false ); + shmctl( shmInfo.shmid, IPC_RMID, 0 ); #if 0 - xvImage = ( XvImage * ) XvCreateImage( display, port, 0x32595559, pix, width , height ); + xvImage = ( XvImage * ) XvCreateImage( display, port, 0x32595559, pix, width , height ); #endif - } - } - } - else - { - gotPort = false; - } + } + } + } + else + { + gotPort = false; + } } XvDisplayer::~XvDisplayer() { - cerr << ">> Destroying XV Displayer" << endl; + cerr << ">> Destroying XV Displayer" << endl; - if ( gotPort ) - { - XvUngrabPort( display, grabbedPort, CurrentTime ); - } + if ( gotPort ) + { + XvUngrabPort( display, grabbedPort, CurrentTime ); + } - if ( xvImage != NULL ) - XvStopVideo( display, port, window ); + if ( xvImage != NULL ) + XvStopVideo( display, port, window ); - if ( shmInfo.shmaddr != NULL ) - { - XShmDetach( display, &shmInfo ); - shmctl( shmInfo.shmid, IPC_RMID, 0 ); - shmdt( shmInfo.shmaddr ); - } - if ( xvImage != NULL ) - XFree( xvImage ); + if ( shmInfo.shmaddr != NULL ) + { + XShmDetach( display, &shmInfo ); + shmctl( shmInfo.shmid, IPC_RMID, 0 ); + shmdt( shmInfo.shmaddr ); + } + if ( xvImage != NULL ) + XFree( xvImage ); } -bool XvDisplayer::usable() +bool +XvDisplayer::usable() { - return gotPort; + return gotPort; } - void XvDisplayer::put( void *image ) - { - AspectRatioCalculator calc( ( ( GtkWidget * ) drawingarea ) ->allocation.width, - ( ( GtkWidget * ) drawingarea ) ->allocation.height, - this->preferredWidth(), this->preferredHeight(), - isPAL, isWidescreen ); +void +XvDisplayer::put( void *image ) +{ + g_assert(drawingarea != NULL); - memcpy( xvImage->data, image, xvImage->data_size ); + if(xvImage != NULL) + { + int video_x = 0, video_y = 0, video_width = 0, video_height = 0; + CalculateVideoLayout( + drawingarea->get_width(), + drawingarea->get_height(), + preferredWidth(), preferredHeight(), + video_x, video_y, video_width, video_height ); - XvShmPutImage( display, port, window, gc, xvImage, - 0, 0, this->preferredWidth(), this->preferredHeight(), - calc.x, calc.y, calc.width, calc.height, false ); - } + memcpy( xvImage->data, image, xvImage->data_size ); + + XvShmPutImage( display, port, window, gc, xvImage, + 0, 0, preferredWidth(), preferredHeight(), + video_x, video_y, video_width, video_height, false ); + } +} } // namespace output } // namespace gui diff --git a/src/gui/src/output/xvdisplayer.hpp b/src/gui/src/output/xvdisplayer.hpp index 77cd27459..6c64609bc 100644 --- a/src/gui/src/output/xvdisplayer.hpp +++ b/src/gui/src/output/xvdisplayer.hpp @@ -27,38 +27,48 @@ ** @see xvdisplayer.cpp */ -#include "displayer.hpp" - +#include +#include +#include #include #include -#include + +#include "displayer.hpp" #ifndef XVDISPLAYER_HPP #define XVDISPLAYER_HPP +namespace Gtk { + class Widget; +} + namespace lumiera { namespace gui { namespace output { - class XvDisplayer + class XvDisplayer : public Displayer { public: - XvDisplayer(); + XvDisplayer( Gtk::Widget *drawingarea, int width, int height ); ~XvDisplayer(); + + void put( void *image ); protected: - void put( void *image ); + bool usable(); private: - bool canuse; - int depth; - GtkWidget *drawingarea; + bool gotPort; + int grabbedPort; + Gtk::Widget *drawingarea; Display *display; Window window; GC gc; - XImage *xImage; XGCValues values; + XvImage *xvImage; + unsigned int port; XShmSegmentInfo shmInfo; + char pix[ MAX_WIDTH * MAX_HEIGHT * 4 ]; }; } // namespace output diff --git a/src/gui/src/widgets/video-display-widget.cpp b/src/gui/src/widgets/video-display-widget.cpp index 16b089c5b..2969f0aec 100644 --- a/src/gui/src/widgets/video-display-widget.cpp +++ b/src/gui/src/widgets/video-display-widget.cpp @@ -30,42 +30,106 @@ namespace lumiera { namespace gui { namespace widgets { -VideoDisplayWidget::VideoDisplayWidget() - { - set_flags(Gtk::NO_WINDOW); - } +VideoDisplayWidget::VideoDisplayWidget() : + gdkWindow(NULL), + xvDisplayer(NULL) +{ + set_flags(Gtk::NO_WINDOW); +} + +VideoDisplayWidget::~VideoDisplayWidget() +{ + if(xvDisplayer != NULL) + delete xvDisplayer; +} void VideoDisplayWidget::on_realize() - { - //Call base class: - Gtk::Widget::on_realize(); +{ + //Call base class: + Gtk::Widget::on_realize(); + if(!gdkWindow) + { + //Create the GdkWindow: + + GdkWindowAttr attributes; + memset(&attributes, 0, sizeof(attributes)); + + Gtk::Allocation allocation = get_allocation(); + + //Set initial position and size of the Gdk::Window: + attributes.x = allocation.get_x(); + attributes.y = allocation.get_y(); + attributes.width = allocation.get_width(); + attributes.height = allocation.get_height(); + + attributes.event_mask = get_events () | Gdk::EXPOSURE_MASK; + attributes.window_type = GDK_WINDOW_CHILD; + attributes.wclass = GDK_INPUT_OUTPUT; + + gdkWindow = Gdk::Window::create(get_window() /* parent */, &attributes, + GDK_WA_X | GDK_WA_Y); + unset_flags(Gtk::NO_WINDOW); + set_window(gdkWindow); + + //set colors + modify_bg(Gtk::STATE_NORMAL , Gdk::Color("black")); + + //make the widget receive expose events + gdkWindow->set_user_data(gobj()); } + xvDisplayer = new XvDisplayer(this, 320, 240 ); + + add_events(Gdk::ALL_EVENTS_MASK); +} + +void +VideoDisplayWidget::on_unrealize() +{ + gdkWindow.clear(); + + //Call base class: + Gtk::Widget::on_unrealize(); +} + +bool +VideoDisplayWidget::on_button_press_event (GdkEventButton* event) +{ + unsigned char buffer[320 * 240 * 4]; + + for(int i = 0; i < 320*240*4; i++) + buffer[i] = rand(); + + xvDisplayer->put((void*)buffer); + + return true; +} + bool VideoDisplayWidget::on_expose_event(GdkEventExpose* event) +{ + // This is where we draw on the window + /*Glib::RefPtr window = get_window(); + if(window) { - // This is where we draw on the window - Glib::RefPtr window = get_window(); - if(window) + Cairo::RefPtr cr = window->create_cairo_context(); + if(event) { - Cairo::RefPtr cr = window->create_cairo_context(); - if(event) - { - // clip to the area that needs to be re-exposed so we don't draw any - // more than we need to. - cr->rectangle(event->area.x, event->area.y, - event->area.width, event->area.height); - cr->clip(); - } - - // Paint the background - cr->set_source_rgb(0.0, 0.0, 0.0); - cr->paint(); + // clip to the area that needs to be re-exposed so we don't draw any + // more than we need to. + cr->rectangle(event->area.x, event->area.y, + event->area.width, event->area.height); + cr->clip(); } - return true; - } + + // Paint the background + cr->set_source_rgb(0.0, 0.0, 0.0); + cr->paint(); + }*/ + return true; +} } // namespace widgets } // namespace gui diff --git a/src/gui/src/widgets/video-display-widget.hpp b/src/gui/src/widgets/video-display-widget.hpp index b7ef32200..b883426ec 100644 --- a/src/gui/src/widgets/video-display-widget.hpp +++ b/src/gui/src/widgets/video-display-widget.hpp @@ -28,6 +28,10 @@ #include +#include "../output/xvdisplayer.hpp" + +using namespace lumiera::gui::output; + namespace lumiera { namespace gui { namespace widgets { @@ -37,14 +41,23 @@ namespace widgets { public: VideoDisplayWidget(); + ~VideoDisplayWidget(); + /* ===== Overrides ===== */ private: virtual void on_realize(); + + virtual void on_unrealize(); + virtual bool on_expose_event(GdkEventExpose* event); +virtual bool on_button_press_event (GdkEventButton* event); + /* ===== Internals ===== */ private: + Glib::RefPtr gdkWindow; + XvDisplayer *xvDisplayer; }; } // namespace widgets From b8c94df12afb439f58a52f4f6c71d19dbba3a47c Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Thu, 8 May 2008 23:09:04 +0100 Subject: [PATCH 032/110] Further XVideo tidy ups --- src/gui/src/Makefile.am | 2 -- src/gui/src/output/xvdisplayer.cpp | 12 ++++++------ src/gui/src/output/xvdisplayer.hpp | 4 ++-- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/gui/src/Makefile.am b/src/gui/src/Makefile.am index 0bee8fedd..29e6a6cfb 100644 --- a/src/gui/src/Makefile.am +++ b/src/gui/src/Makefile.am @@ -39,8 +39,6 @@ gtk_lumiera_SOURCES = \ widgets/timeline-widget.hpp \ model/project.cpp \ model/project.hpp \ - output/aspectratiocalculator.cpp \ - output/aspectratiocalculator.hpp \ output/displayer.cpp \ output/displayer.hpp \ output/xvdisplayer.cpp \ diff --git a/src/gui/src/output/xvdisplayer.cpp b/src/gui/src/output/xvdisplayer.cpp index 8fe96d03f..0ed73b7b0 100644 --- a/src/gui/src/output/xvdisplayer.cpp +++ b/src/gui/src/output/xvdisplayer.cpp @@ -38,19 +38,19 @@ namespace lumiera { namespace gui { namespace output { -XvDisplayer::XvDisplayer( Gtk::Widget *drawingarea, int width, int height ) : +XvDisplayer::XvDisplayer( Gtk::Widget *drawing_area, int width, int height ) : xvImage( NULL ) { cerr << ">> Trying XVideo at " << width << "x" << height << endl; - this->drawingarea = drawingarea; + this->drawingArea = drawing_area; imageWidth = width; imageHeight = height; shmInfo.shmaddr = NULL; gotPort = false; - Glib::RefPtr area_window = drawingarea->get_window(); + Glib::RefPtr area_window = drawing_area->get_window(); window = gdk_x11_drawable_get_xid( area_window->gobj() ); display = gdk_x11_drawable_get_xdisplay( area_window->gobj() ); @@ -209,14 +209,14 @@ XvDisplayer::usable() void XvDisplayer::put( void *image ) { - g_assert(drawingarea != NULL); + g_assert(drawingArea != NULL); if(xvImage != NULL) { int video_x = 0, video_y = 0, video_width = 0, video_height = 0; CalculateVideoLayout( - drawingarea->get_width(), - drawingarea->get_height(), + drawingArea->get_width(), + drawingArea->get_height(), preferredWidth(), preferredHeight(), video_x, video_y, video_width, video_height ); diff --git a/src/gui/src/output/xvdisplayer.hpp b/src/gui/src/output/xvdisplayer.hpp index 6c64609bc..6daf614cf 100644 --- a/src/gui/src/output/xvdisplayer.hpp +++ b/src/gui/src/output/xvdisplayer.hpp @@ -49,7 +49,7 @@ namespace output { class XvDisplayer : public Displayer { public: - XvDisplayer( Gtk::Widget *drawingarea, int width, int height ); + XvDisplayer( Gtk::Widget *drawing_area, int width, int height ); ~XvDisplayer(); void put( void *image ); @@ -60,7 +60,7 @@ namespace output { private: bool gotPort; int grabbedPort; - Gtk::Widget *drawingarea; + Gtk::Widget *drawingArea; Display *display; Window window; GC gc; From 67413c7c17ce10b36255a857daee3c0318257777 Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Thu, 8 May 2008 23:34:28 +0100 Subject: [PATCH 033/110] Made a temporary fix for the crash-on-undock bug --- src/gui/src/output/xvdisplayer.cpp | 5 +- src/gui/src/widgets/video-display-widget.cpp | 48 ++++++++++---------- 2 files changed, 27 insertions(+), 26 deletions(-) diff --git a/src/gui/src/output/xvdisplayer.cpp b/src/gui/src/output/xvdisplayer.cpp index 0ed73b7b0..5ca9d8c63 100644 --- a/src/gui/src/output/xvdisplayer.cpp +++ b/src/gui/src/output/xvdisplayer.cpp @@ -187,8 +187,8 @@ XvDisplayer::~XvDisplayer() XvUngrabPort( display, grabbedPort, CurrentTime ); } - if ( xvImage != NULL ) - XvStopVideo( display, port, window ); + //if ( xvImage != NULL ) + // XvStopVideo( display, port, window ); if ( shmInfo.shmaddr != NULL ) { @@ -196,6 +196,7 @@ XvDisplayer::~XvDisplayer() shmctl( shmInfo.shmid, IPC_RMID, 0 ); shmdt( shmInfo.shmaddr ); } + if ( xvImage != NULL ) XFree( xvImage ); } diff --git a/src/gui/src/widgets/video-display-widget.cpp b/src/gui/src/widgets/video-display-widget.cpp index 2969f0aec..6ec626e9d 100644 --- a/src/gui/src/widgets/video-display-widget.cpp +++ b/src/gui/src/widgets/video-display-widget.cpp @@ -46,40 +46,40 @@ VideoDisplayWidget::~VideoDisplayWidget() void VideoDisplayWidget::on_realize() { + set_flags(Gtk::NO_WINDOW); + //Call base class: Gtk::Widget::on_realize(); - if(!gdkWindow) - { - //Create the GdkWindow: + //Create the GdkWindow: + GdkWindowAttr attributes; + memset(&attributes, 0, sizeof(attributes)); - GdkWindowAttr attributes; - memset(&attributes, 0, sizeof(attributes)); + Gtk::Allocation allocation = get_allocation(); - Gtk::Allocation allocation = get_allocation(); + //Set initial position and size of the Gdk::Window: + attributes.x = allocation.get_x(); + attributes.y = allocation.get_y(); + attributes.width = allocation.get_width(); + attributes.height = allocation.get_height(); - //Set initial position and size of the Gdk::Window: - attributes.x = allocation.get_x(); - attributes.y = allocation.get_y(); - attributes.width = allocation.get_width(); - attributes.height = allocation.get_height(); + attributes.event_mask = get_events () | Gdk::EXPOSURE_MASK; + attributes.window_type = GDK_WINDOW_CHILD; + attributes.wclass = GDK_INPUT_OUTPUT; - attributes.event_mask = get_events () | Gdk::EXPOSURE_MASK; - attributes.window_type = GDK_WINDOW_CHILD; - attributes.wclass = GDK_INPUT_OUTPUT; + gdkWindow = Gdk::Window::create(get_window() /* parent */, &attributes, + GDK_WA_X | GDK_WA_Y); + unset_flags(Gtk::NO_WINDOW); + set_window(gdkWindow); - gdkWindow = Gdk::Window::create(get_window() /* parent */, &attributes, - GDK_WA_X | GDK_WA_Y); - unset_flags(Gtk::NO_WINDOW); - set_window(gdkWindow); + //set colors + modify_bg(Gtk::STATE_NORMAL , Gdk::Color("black")); - //set colors - modify_bg(Gtk::STATE_NORMAL , Gdk::Color("black")); - - //make the widget receive expose events - gdkWindow->set_user_data(gobj()); - } + //make the widget receive expose events + gdkWindow->set_user_data(gobj()); + if(xvDisplayer != NULL) + delete xvDisplayer; xvDisplayer = new XvDisplayer(this, 320, 240 ); add_events(Gdk::ALL_EVENTS_MASK); From f72dab3257c506fea5dc10ae0a6cc7e441bcf17c Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Mon, 12 May 2008 13:02:14 +0100 Subject: [PATCH 034/110] Added support for video via a GDK fallback --- src/gui/src/Makefile.am | 2 + src/gui/src/output/displayer.cpp | 22 +++--- src/gui/src/output/displayer.hpp | 2 +- src/gui/src/output/gdkdisplayer.cpp | 76 ++++++++++++++++++++ src/gui/src/output/gdkdisplayer.hpp | 62 ++++++++++++++++ src/gui/src/output/xvdisplayer.cpp | 13 ++-- src/gui/src/output/xvdisplayer.hpp | 3 +- src/gui/src/widgets/video-display-widget.cpp | 37 ++++++++-- src/gui/src/widgets/video-display-widget.hpp | 10 ++- 9 files changed, 198 insertions(+), 29 deletions(-) create mode 100644 src/gui/src/output/gdkdisplayer.cpp create mode 100644 src/gui/src/output/gdkdisplayer.hpp diff --git a/src/gui/src/Makefile.am b/src/gui/src/Makefile.am index 29e6a6cfb..455dcdd60 100644 --- a/src/gui/src/Makefile.am +++ b/src/gui/src/Makefile.am @@ -41,6 +41,8 @@ gtk_lumiera_SOURCES = \ model/project.hpp \ output/displayer.cpp \ output/displayer.hpp \ + output/gdkdisplayer.cpp \ + output/gdkdisplayer.hpp \ output/xvdisplayer.cpp \ output/xvdisplayer.hpp diff --git a/src/gui/src/output/displayer.cpp b/src/gui/src/output/displayer.cpp index 359d0aaa3..567bc8748 100644 --- a/src/gui/src/output/displayer.cpp +++ b/src/gui/src/output/displayer.cpp @@ -23,6 +23,8 @@ * *****************************************************/ #include "displayer.hpp" +#include "xvdisplayer.hpp" +#include "gdkdisplayer.hpp" namespace lumiera { namespace gui { @@ -31,7 +33,7 @@ namespace output { bool Displayer::usable() { - return false; + return false; } DisplayerInput @@ -53,19 +55,19 @@ Displayer::preferredHeight() } void -Displayer::CalculateVideoLayout( +Displayer::calculateVideoLayout( int widget_width, int widget_height, int image_width, int image_height, int &video_x, int &video_y, int &video_width, int &video_height ) { - double ratio_width = ( double ) widget_width / ( double ) image_width; - double ratio_height = ( double ) widget_height / ( double ) image_height; - double ratio_constant = ratio_height < ratio_width ? - ratio_height : ratio_width; - video_width = ( int ) ( image_width * ratio_constant + 0.5 ); - video_height = ( int ) ( image_height * ratio_constant + 0.5 ); - video_x = ( widget_width - video_width ) / 2; - video_y = ( widget_height - video_height ) / 2; + double ratio_width = ( double ) widget_width / ( double ) image_width; + double ratio_height = ( double ) widget_height / ( double ) image_height; + double ratio_constant = ratio_height < ratio_width ? + ratio_height : ratio_width; + video_width = ( int ) ( image_width * ratio_constant + 0.5 ); + video_height = ( int ) ( image_height * ratio_constant + 0.5 ); + video_x = ( widget_width - video_width ) / 2; + video_y = ( widget_height - video_height ) / 2; } } // namespace output diff --git a/src/gui/src/output/displayer.hpp b/src/gui/src/output/displayer.hpp index 2d568607e..c117d5cb9 100644 --- a/src/gui/src/output/displayer.hpp +++ b/src/gui/src/output/displayer.hpp @@ -99,7 +99,7 @@ namespace output { protected: - static void CalculateVideoLayout( + static void calculateVideoLayout( int widget_width, int widget_height, int image_width, int image_height, int &video_x, int &video_y, int &video_width, int &video_height ); diff --git a/src/gui/src/output/gdkdisplayer.cpp b/src/gui/src/output/gdkdisplayer.cpp new file mode 100644 index 000000000..262d28d5b --- /dev/null +++ b/src/gui/src/output/gdkdisplayer.cpp @@ -0,0 +1,76 @@ +/* + gdkdisplayer.cpp - Implements the class for displaying video via GDK + + Copyright (C) Lumiera.org + 2000, Arne Schirmacher + 2001-2007, Dan Dennedy + 2008, Joel Holdsworth + + 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. + +* *****************************************************/ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +using std::cerr; +using std::endl; + +#include "gdkdisplayer.hpp" + +namespace lumiera { +namespace gui { +namespace output { + +GdkDisplayer::GdkDisplayer( Gtk::Widget *drawing_area, int width, int height ) : + drawingArea( drawing_area ) +{ + imageWidth = width, imageHeight = height; +} + +bool +GdkDisplayer::usable() +{ + return true; +} + +void +GdkDisplayer::put( void *image ) +{ + int video_x = 0, video_y = 0, video_width = 0, video_height = 0; + calculateVideoLayout( + drawingArea->get_width(), + drawingArea->get_height(), + preferredWidth(), preferredHeight(), + video_x, video_y, video_width, video_height ); + + GdkWindow *window = drawingArea->get_window()->gobj(); + GdkGC *gc = gdk_gc_new( window ); + GdkPixbuf *pix = gdk_pixbuf_new_from_data( (const guchar*)image, GDK_COLORSPACE_RGB, FALSE, 8, + preferredWidth(), preferredHeight(), preferredWidth() * 3, NULL, NULL ); + GdkPixbuf *im = gdk_pixbuf_scale_simple( pix, video_width, video_height, GDK_INTERP_NEAREST ); + gdk_draw_pixbuf( window, gc, im, 0, 0, video_x, video_y, -1, -1, GDK_RGB_DITHER_NORMAL, 0, 0 ); + g_object_unref( im ); + g_object_unref( pix ); + g_object_unref( gc ); +} + +} // namespace output +} // namespace gui +} // namespace lumiera diff --git a/src/gui/src/output/gdkdisplayer.hpp b/src/gui/src/output/gdkdisplayer.hpp new file mode 100644 index 000000000..7e72fa24e --- /dev/null +++ b/src/gui/src/output/gdkdisplayer.hpp @@ -0,0 +1,62 @@ +/* + gdkdisplayer.hpp - Defines the class for displaying video via GDK + + Copyright (C) Lumiera.org + 2000, Arne Schirmacher + 2001-2007, Dan Dennedy + 2008, Joel Holdsworth + + 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. + +*/ +/** @file gdkdisplayer.hpp + ** This file contains the definition of XvDisplayer, the XVideo + ** video output implementation + ** @see gdkdisplayer.cpp + ** @see displayer.hpp + */ + +#include "displayer.hpp" + +#ifndef GDKDISPLAYER_HPP +#define GDKDISPLAYER_HPP + +namespace Gtk { + class Widget; +} + +namespace lumiera { +namespace gui { +namespace output { + + class GdkDisplayer : public Displayer + { + public: + GdkDisplayer( Gtk::Widget *drawing_area, int width, int height ); + + void put( void *image ); + + protected: + bool usable(); + + private: + Gtk::Widget *drawingArea; + }; + +} // namespace output +} // namespace gui +} // namespace lumiera + +#endif // GDKDISPLAYER_HPP diff --git a/src/gui/src/output/xvdisplayer.cpp b/src/gui/src/output/xvdisplayer.cpp index 5ca9d8c63..428decc62 100644 --- a/src/gui/src/output/xvdisplayer.cpp +++ b/src/gui/src/output/xvdisplayer.cpp @@ -1,5 +1,5 @@ /* - displayer.cpp - Implements the base class for displaying video + xvdisplayer.cpp - Implements the base class for XVideo display Copyright (C) Lumiera.org 2000, Arne Schirmacher @@ -39,16 +39,15 @@ namespace gui { namespace output { XvDisplayer::XvDisplayer( Gtk::Widget *drawing_area, int width, int height ) : - xvImage( NULL ) + xvImage( NULL ), + drawingArea( drawing_area ), + gotPort( false ) { cerr << ">> Trying XVideo at " << width << "x" << height << endl; - this->drawingArea = drawing_area; - imageWidth = width; - imageHeight = height; + imageWidth = width, imageHeight = height; shmInfo.shmaddr = NULL; - gotPort = false; Glib::RefPtr area_window = drawing_area->get_window(); @@ -215,7 +214,7 @@ XvDisplayer::put( void *image ) if(xvImage != NULL) { int video_x = 0, video_y = 0, video_width = 0, video_height = 0; - CalculateVideoLayout( + calculateVideoLayout( drawingArea->get_width(), drawingArea->get_height(), preferredWidth(), preferredHeight(), diff --git a/src/gui/src/output/xvdisplayer.hpp b/src/gui/src/output/xvdisplayer.hpp index 6daf614cf..aae4e0281 100644 --- a/src/gui/src/output/xvdisplayer.hpp +++ b/src/gui/src/output/xvdisplayer.hpp @@ -1,5 +1,5 @@ /* - xcdisplayer.hpp - Defines the base class for XVideo display + xvdisplayer.hpp - Defines the base class for XVideo display Copyright (C) Lumiera.org 2000, Arne Schirmacher @@ -25,6 +25,7 @@ ** This file contains the definition of XvDisplayer, the XVideo ** video output implementation ** @see xvdisplayer.cpp + ** @see displayer.hpp */ #include diff --git a/src/gui/src/widgets/video-display-widget.cpp b/src/gui/src/widgets/video-display-widget.cpp index 6ec626e9d..87fff7ecd 100644 --- a/src/gui/src/widgets/video-display-widget.cpp +++ b/src/gui/src/widgets/video-display-widget.cpp @@ -24,6 +24,9 @@ #include #include +#include "../output/xvdisplayer.hpp" +#include "../output/gdkdisplayer.hpp" + #include "video-display-widget.hpp" namespace lumiera { @@ -32,15 +35,15 @@ namespace widgets { VideoDisplayWidget::VideoDisplayWidget() : gdkWindow(NULL), - xvDisplayer(NULL) + displayer(NULL) { set_flags(Gtk::NO_WINDOW); } VideoDisplayWidget::~VideoDisplayWidget() { - if(xvDisplayer != NULL) - delete xvDisplayer; + if(displayer != NULL) + delete displayer; } void @@ -78,9 +81,9 @@ VideoDisplayWidget::on_realize() //make the widget receive expose events gdkWindow->set_user_data(gobj()); - if(xvDisplayer != NULL) - delete xvDisplayer; - xvDisplayer = new XvDisplayer(this, 320, 240 ); + if(displayer != NULL) + delete displayer; + displayer = createDisplayer(this, 320, 240); add_events(Gdk::ALL_EVENTS_MASK); } @@ -102,7 +105,7 @@ VideoDisplayWidget::on_button_press_event (GdkEventButton* event) for(int i = 0; i < 320*240*4; i++) buffer[i] = rand(); - xvDisplayer->put((void*)buffer); + displayer->put((void*)buffer); return true; } @@ -131,6 +134,26 @@ VideoDisplayWidget::on_expose_event(GdkEventExpose* event) return true; } +Displayer* +VideoDisplayWidget::createDisplayer( Gtk::Widget *drawingArea, int width, int height ) +{ + Displayer *displayer = NULL; + + displayer = new XvDisplayer( drawingArea, width, height ); + if ( !displayer->usable() ) + { + delete displayer; + displayer = NULL; + } + + if ( displayer == NULL ) + { + displayer = new GdkDisplayer( drawingArea, width, height ); + } + + return displayer; +} + } // namespace widgets } // namespace gui } // namespace lumiera diff --git a/src/gui/src/widgets/video-display-widget.hpp b/src/gui/src/widgets/video-display-widget.hpp index b883426ec..7a80a4b04 100644 --- a/src/gui/src/widgets/video-display-widget.hpp +++ b/src/gui/src/widgets/video-display-widget.hpp @@ -28,7 +28,7 @@ #include -#include "../output/xvdisplayer.hpp" +#include "../output/displayer.hpp" using namespace lumiera::gui::output; @@ -51,13 +51,17 @@ namespace widgets { virtual bool on_expose_event(GdkEventExpose* event); -virtual bool on_button_press_event (GdkEventButton* event); + virtual bool on_button_press_event (GdkEventButton* event); /* ===== Internals ===== */ + private: + static Displayer* + createDisplayer( Gtk::Widget *drawingArea, int width, int height ); + private: Glib::RefPtr gdkWindow; - XvDisplayer *xvDisplayer; + Displayer *displayer; }; } // namespace widgets From ed2146dae069aec4c4c0b1403b1e5f13cdcf19ba Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Tue, 13 May 2008 17:33:18 +0100 Subject: [PATCH 035/110] Added the icon which will be used for the video viewer panel's caption --- src/gui/icons/viewer-panel.png | Bin 0 -> 631 bytes src/gui/src/widgets/video-display-widget.cpp | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 src/gui/icons/viewer-panel.png diff --git a/src/gui/icons/viewer-panel.png b/src/gui/icons/viewer-panel.png new file mode 100644 index 0000000000000000000000000000000000000000..a73a169ac5130a02303b025b4b4fc957f6da4602 GIT binary patch literal 631 zcmV--0*L*IP)Mh53JODVWnpw>WFU8GbZ8({Xk{Qr zNlj3Y*^6%g00F~EL_t(I%cYV*YZFlr$A51(OE!uLO)CiM!JbSJKR}B$UbG6i=*hcc z5O22P7Z5}cJ&5+My=uIqYY*bV#IvU!g6PS#8WNM;u=_Uq@;oHFR2rqkfnj)m-v2iY zGveW+2QPp!)5UrUD6d>znab^KI^|USc>b(Py|#S-n`Uuof!lYk0FVIcwQWkJB1(bQ zn&D7mn#M##wfbQ{06?ix6+&Q|BGFwpKuU#DLs~8W4_Ina2hWrEzM|ic2t$Ps0uUI6 zz_v6026Ve2?RGRaS=hFf0OI;rK&uro7#L(Sb}~v_4P!540$_2eK)v?yKFj>M z>e@B*nnvqUqCtid4Ol5_q%+c!KV!hUv*}EIiSa-gAbaor>Zj#%=MR7V_GL~=X@p@o zIvox9{0s|)GqUowvh(Ee(-P1Hy734Wklx+>QFGni^~ux z@28v1=6ApbB;dyY1w=s*)L(AA>J$p6ubw!5GCx0m%FfTsibkUmI`6i8&-Fat58eZV zaRz&LatO!)M{eG_aaSpo)FG|gset_user_data(gobj()); From 05055fa7952004d6b8211dd5c8d1171a2afbac48 Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Tue, 13 May 2008 20:07:21 +0100 Subject: [PATCH 036/110] Added POTFILES.in --- src/gui/po/POTFILES.in | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 src/gui/po/POTFILES.in diff --git a/src/gui/po/POTFILES.in b/src/gui/po/POTFILES.in new file mode 100644 index 000000000..f8afa6162 --- /dev/null +++ b/src/gui/po/POTFILES.in @@ -0,0 +1,12 @@ +# List of source files containing translatable strings. + +src/gtk-lumiera.cpp + +src/workspace/actions.cpp + +src/dialogs/preferences-dialog.cpp +src/dialogs/render.cpp + +src/panels/assets-panel.cpp +src/panels/timeline-panel.cpp +src/panels/viewer-panel.cpp From ae2c74ff42f77e6c3a6e19cb7780a1762834ce58 Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Wed, 14 May 2008 00:26:00 +0100 Subject: [PATCH 037/110] Tied gui into main lumiera build --- Makefile.am | 3 + configure.ac | 46 ++++++++++ {src/gui/icons => icons}/viewer-panel.png | Bin {src/gui/po => po}/ChangeLog | 0 {src/gui/po => po}/LINGUAS | 0 {src/gui/po => po}/POTFILES.in | 0 src/gui/Makefile.am | 83 +++++++++++++++--- .../{src => }/dialogs/preferences-dialog.cpp | 0 .../{src => }/dialogs/preferences-dialog.hpp | 0 src/gui/{src => }/dialogs/render.cpp | 0 src/gui/{src => }/dialogs/render.hpp | 0 src/gui/{src => }/gtk-lumiera.cpp | 0 src/gui/{src => }/gtk-lumiera.hpp | 0 src/gui/{src => }/lumiera_ui.rc | 0 src/gui/{src => }/model/project.cpp | 0 src/gui/{src => }/model/project.hpp | 0 src/gui/{src => }/output/displayer.cpp | 0 src/gui/{src => }/output/displayer.hpp | 0 src/gui/{src => }/output/gdkdisplayer.cpp | 0 src/gui/{src => }/output/gdkdisplayer.hpp | 0 src/gui/{src => }/output/xvdisplayer.cpp | 0 src/gui/{src => }/output/xvdisplayer.hpp | 0 src/gui/{src => }/panels/assets-panel.cpp | 0 src/gui/{src => }/panels/assets-panel.hpp | 0 src/gui/{src => }/panels/panel.cpp | 0 src/gui/{src => }/panels/panel.hpp | 0 src/gui/{src => }/panels/timeline-panel.cpp | 0 src/gui/{src => }/panels/timeline-panel.hpp | 0 src/gui/{src => }/panels/viewer-panel.cpp | 0 src/gui/{src => }/panels/viewer-panel.hpp | 0 src/gui/src/Makefile.am | 55 ------------ src/gui/{src => }/widgets/timeline-widget.cpp | 0 src/gui/{src => }/widgets/timeline-widget.hpp | 0 .../widgets/video-display-widget.cpp | 0 .../widgets/video-display-widget.hpp | 0 src/gui/{src => }/window-manager.cpp | 0 src/gui/{src => }/window-manager.hpp | 0 src/gui/{src => }/workspace/actions.cpp | 0 src/gui/{src => }/workspace/actions.hpp | 0 .../{src => }/workspace/workspace-window.cpp | 2 +- .../{src => }/workspace/workspace-window.hpp | 0 41 files changed, 121 insertions(+), 68 deletions(-) rename {src/gui/icons => icons}/viewer-panel.png (100%) rename {src/gui/po => po}/ChangeLog (100%) rename {src/gui/po => po}/LINGUAS (100%) rename {src/gui/po => po}/POTFILES.in (100%) rename src/gui/{src => }/dialogs/preferences-dialog.cpp (100%) rename src/gui/{src => }/dialogs/preferences-dialog.hpp (100%) rename src/gui/{src => }/dialogs/render.cpp (100%) rename src/gui/{src => }/dialogs/render.hpp (100%) rename src/gui/{src => }/gtk-lumiera.cpp (100%) rename src/gui/{src => }/gtk-lumiera.hpp (100%) rename src/gui/{src => }/lumiera_ui.rc (100%) rename src/gui/{src => }/model/project.cpp (100%) rename src/gui/{src => }/model/project.hpp (100%) rename src/gui/{src => }/output/displayer.cpp (100%) rename src/gui/{src => }/output/displayer.hpp (100%) rename src/gui/{src => }/output/gdkdisplayer.cpp (100%) rename src/gui/{src => }/output/gdkdisplayer.hpp (100%) rename src/gui/{src => }/output/xvdisplayer.cpp (100%) rename src/gui/{src => }/output/xvdisplayer.hpp (100%) rename src/gui/{src => }/panels/assets-panel.cpp (100%) rename src/gui/{src => }/panels/assets-panel.hpp (100%) rename src/gui/{src => }/panels/panel.cpp (100%) rename src/gui/{src => }/panels/panel.hpp (100%) rename src/gui/{src => }/panels/timeline-panel.cpp (100%) rename src/gui/{src => }/panels/timeline-panel.hpp (100%) rename src/gui/{src => }/panels/viewer-panel.cpp (100%) rename src/gui/{src => }/panels/viewer-panel.hpp (100%) delete mode 100644 src/gui/src/Makefile.am rename src/gui/{src => }/widgets/timeline-widget.cpp (100%) rename src/gui/{src => }/widgets/timeline-widget.hpp (100%) rename src/gui/{src => }/widgets/video-display-widget.cpp (100%) rename src/gui/{src => }/widgets/video-display-widget.hpp (100%) rename src/gui/{src => }/window-manager.cpp (100%) rename src/gui/{src => }/window-manager.hpp (100%) rename src/gui/{src => }/workspace/actions.cpp (100%) rename src/gui/{src => }/workspace/actions.hpp (100%) rename src/gui/{src => }/workspace/workspace-window.cpp (99%) rename src/gui/{src => }/workspace/workspace-window.hpp (100%) diff --git a/Makefile.am b/Makefile.am index 69cc34288..bf4c80872 100644 --- a/Makefile.am +++ b/Makefile.am @@ -36,6 +36,9 @@ include $(top_srcdir)/admin/Makefile.am include $(top_srcdir)/src/lib/Makefile.am #include $(top_srcdir)/src/backend/Makefile.am +# gui +include $(top_srcdir)/src/gui/Makefile.am + # plugins #include $(top_srcdir)/src... diff --git a/configure.ac b/configure.ac index 78d76c136..e179d8a24 100644 --- a/configure.ac +++ b/configure.ac @@ -75,5 +75,51 @@ AC_MSG_RESULT([NoBug build level: $nobug_level]) # END NoBug +############## Internatinalization +#GETTEXT_PACKAGE=gtk-lumiera +#AC_SUBST(GETTEXT_PACKAGE) +#AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [GETTEXT package name]) +#AM_GLIB_GNU_GETTEXT +#IT_PROG_INTLTOOL([0.35.0]) + +# END Internatinalization + + +############## X11 Dependancies +AC_PATH_X +AC_PATH_XTRA +# CFLAGS="$CFLAGS $X_CFLAGS" +LIBS="$LIBS $X_PRE_LIBS $X_LIBS $X_EXTRA_LIBS" + +AC_CHECK_HEADERS([X11/Xlib.h X11/Xutil.h],[], + [AC_MSG_ERROR([Xlib.h or Xutil.h not found install xdevel])]) + +AC_CHECK_HEADERS([sys/ipc.h sys/shm.h],, + [AC_MSG_ERROR([Required header not found. Please check that it is installed])] +) +AC_CHECK_HEADERS([X11/extensions/Xvlib.h X11/extensions/XShm.h],, + [AC_MSG_ERROR([Required xvideo (Xv) extension to X not found. Please check that it is installed.])], + [#include ] +) + +AC_CHECK_LIB(Xext, XInitExtension, , + [AC_MSG_ERROR([Could not link with libXext. Check that you have libXext installed])], -lX11 +) +AC_CHECK_LIB(Xv, XvQueryAdaptors, , + [AC_MSG_ERROR([Could not link with libXv. Check that you have libXv installed])] +) + +# END X11 Dependancies + + +############## Gtk Dependancies +PKG_CHECK_MODULES(GTK_LUMIERA, [gtkmm-2.4 >= 2.8 gdl-1.0 >= 0.6.1 cairomm-1.0 >= 0.6.0]) + +AC_SUBST(GTK_LUMIERA_CFLAGS) +AC_SUBST(GTK_LUMIERA_LIBS) + +# END Gtk Dependancies + + AC_CONFIG_FILES(Makefile) AC_OUTPUT diff --git a/src/gui/icons/viewer-panel.png b/icons/viewer-panel.png similarity index 100% rename from src/gui/icons/viewer-panel.png rename to icons/viewer-panel.png diff --git a/src/gui/po/ChangeLog b/po/ChangeLog similarity index 100% rename from src/gui/po/ChangeLog rename to po/ChangeLog diff --git a/src/gui/po/LINGUAS b/po/LINGUAS similarity index 100% rename from src/gui/po/LINGUAS rename to po/LINGUAS diff --git a/src/gui/po/POTFILES.in b/po/POTFILES.in similarity index 100% rename from src/gui/po/POTFILES.in rename to po/POTFILES.in diff --git a/src/gui/Makefile.am b/src/gui/Makefile.am index 50af375e8..818c2f582 100644 --- a/src/gui/Makefile.am +++ b/src/gui/Makefile.am @@ -1,17 +1,76 @@ -## Process this file with automake to produce Makefile.in +# Copyright (C) Lumiera.org +# 2007, Joel Holdsworth +# +# 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. -SUBDIRS = src po +lumigui_srcdir = $(top_srcdir)/src/gui +#noinst_LIBRARIES += liblumigui.a -gtk_lumieradocdir = ${prefix}/doc/gtk-lumiera -gtk_lumieradoc_DATA = +#lumigui_CFLAGS = $(CFLAGS) -std=gnu99 -Wall -Werror +#lumigui_CPPFLAGS = -I$(top_srcdir)/src/ -EXTRA_DIST = $(gtk_lumieradoc_DATA) +INCLUDES = \ + -DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \ + -DPACKAGE_SRC_DIR=\""$(srcdir)"\" \ + -DPACKAGE_DATA_DIR=\""$(datadir)"\" \ + $(GTK_LUMIERA_CFLAGS) -# Copy all the spec files. Of cource, only one is actually used. -dist-hook: - for specfile in *.spec; do \ - if test -f $$specfile; then \ - cp -p $$specfile $(distdir); \ - fi \ - done +AM_CFLAGS =\ + -Wall\ + -g +bin_PROGRAMS += lumigui + +lumigui_SOURCES = \ + $(lumigui_srcdir)/gtk-lumiera.cpp \ + $(lumigui_srcdir)/gtk-lumiera.hpp \ + $(lumigui_srcdir)/window-manager.cpp \ + $(lumigui_srcdir)/window-manager.hpp \ + $(lumigui_srcdir)/workspace/actions.cpp \ + $(lumigui_srcdir)/workspace/actions.hpp \ + $(lumigui_srcdir)/workspace/workspace-window.cpp \ + $(lumigui_srcdir)/workspace/workspace-window.hpp \ + $(lumigui_srcdir)/dialogs/render.cpp \ + $(lumigui_srcdir)/dialogs/render.hpp \ + $(lumigui_srcdir)/dialogs/preferences-dialog.cpp \ + $(lumigui_srcdir)/dialogs/preferences-dialog.hpp \ + $(lumigui_srcdir)/panels/panel.cpp \ + $(lumigui_srcdir)/panels/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)/panels/assets-panel.cpp \ + $(lumigui_srcdir)/panels/asset-panels.hpp \ + $(lumigui_srcdir)/widgets/video-display-widget.cpp \ + $(lumigui_srcdir)/widgets/video-display-widget.hpp \ + $(lumigui_srcdir)/widgets/timeline-widget.cpp \ + $(lumigui_srcdir)/widgets/timeline-widget.hpp \ + $(lumigui_srcdir)/model/project.cpp \ + $(lumigui_srcdir)/model/project.hpp \ + $(lumigui_srcdir)/output/displayer.cpp \ + $(lumigui_srcdir)/output/displayer.hpp \ + $(lumigui_srcdir)/output/gdkdisplayer.cpp \ + $(lumigui_srcdir)/output/gdkdisplayer.hpp \ + $(lumigui_srcdir)/output/xvdisplayer.cpp \ + $(lumigui_srcdir)/output/xvdisplayer.hpp + +lumigui_LDFLAGS = +lumigui_LDADD = $(GTK_LUMIERA_LIBS) + +themesdir = $(datadir)/themes +themes_DATA = $(lumigui_srcdir)/lumiera_ui.rc + +EXTRA_DIST += $(themes_DATA) diff --git a/src/gui/src/dialogs/preferences-dialog.cpp b/src/gui/dialogs/preferences-dialog.cpp similarity index 100% rename from src/gui/src/dialogs/preferences-dialog.cpp rename to src/gui/dialogs/preferences-dialog.cpp diff --git a/src/gui/src/dialogs/preferences-dialog.hpp b/src/gui/dialogs/preferences-dialog.hpp similarity index 100% rename from src/gui/src/dialogs/preferences-dialog.hpp rename to src/gui/dialogs/preferences-dialog.hpp diff --git a/src/gui/src/dialogs/render.cpp b/src/gui/dialogs/render.cpp similarity index 100% rename from src/gui/src/dialogs/render.cpp rename to src/gui/dialogs/render.cpp diff --git a/src/gui/src/dialogs/render.hpp b/src/gui/dialogs/render.hpp similarity index 100% rename from src/gui/src/dialogs/render.hpp rename to src/gui/dialogs/render.hpp diff --git a/src/gui/src/gtk-lumiera.cpp b/src/gui/gtk-lumiera.cpp similarity index 100% rename from src/gui/src/gtk-lumiera.cpp rename to src/gui/gtk-lumiera.cpp diff --git a/src/gui/src/gtk-lumiera.hpp b/src/gui/gtk-lumiera.hpp similarity index 100% rename from src/gui/src/gtk-lumiera.hpp rename to src/gui/gtk-lumiera.hpp diff --git a/src/gui/src/lumiera_ui.rc b/src/gui/lumiera_ui.rc similarity index 100% rename from src/gui/src/lumiera_ui.rc rename to src/gui/lumiera_ui.rc diff --git a/src/gui/src/model/project.cpp b/src/gui/model/project.cpp similarity index 100% rename from src/gui/src/model/project.cpp rename to src/gui/model/project.cpp diff --git a/src/gui/src/model/project.hpp b/src/gui/model/project.hpp similarity index 100% rename from src/gui/src/model/project.hpp rename to src/gui/model/project.hpp diff --git a/src/gui/src/output/displayer.cpp b/src/gui/output/displayer.cpp similarity index 100% rename from src/gui/src/output/displayer.cpp rename to src/gui/output/displayer.cpp diff --git a/src/gui/src/output/displayer.hpp b/src/gui/output/displayer.hpp similarity index 100% rename from src/gui/src/output/displayer.hpp rename to src/gui/output/displayer.hpp diff --git a/src/gui/src/output/gdkdisplayer.cpp b/src/gui/output/gdkdisplayer.cpp similarity index 100% rename from src/gui/src/output/gdkdisplayer.cpp rename to src/gui/output/gdkdisplayer.cpp diff --git a/src/gui/src/output/gdkdisplayer.hpp b/src/gui/output/gdkdisplayer.hpp similarity index 100% rename from src/gui/src/output/gdkdisplayer.hpp rename to src/gui/output/gdkdisplayer.hpp diff --git a/src/gui/src/output/xvdisplayer.cpp b/src/gui/output/xvdisplayer.cpp similarity index 100% rename from src/gui/src/output/xvdisplayer.cpp rename to src/gui/output/xvdisplayer.cpp diff --git a/src/gui/src/output/xvdisplayer.hpp b/src/gui/output/xvdisplayer.hpp similarity index 100% rename from src/gui/src/output/xvdisplayer.hpp rename to src/gui/output/xvdisplayer.hpp diff --git a/src/gui/src/panels/assets-panel.cpp b/src/gui/panels/assets-panel.cpp similarity index 100% rename from src/gui/src/panels/assets-panel.cpp rename to src/gui/panels/assets-panel.cpp diff --git a/src/gui/src/panels/assets-panel.hpp b/src/gui/panels/assets-panel.hpp similarity index 100% rename from src/gui/src/panels/assets-panel.hpp rename to src/gui/panels/assets-panel.hpp diff --git a/src/gui/src/panels/panel.cpp b/src/gui/panels/panel.cpp similarity index 100% rename from src/gui/src/panels/panel.cpp rename to src/gui/panels/panel.cpp diff --git a/src/gui/src/panels/panel.hpp b/src/gui/panels/panel.hpp similarity index 100% rename from src/gui/src/panels/panel.hpp rename to src/gui/panels/panel.hpp diff --git a/src/gui/src/panels/timeline-panel.cpp b/src/gui/panels/timeline-panel.cpp similarity index 100% rename from src/gui/src/panels/timeline-panel.cpp rename to src/gui/panels/timeline-panel.cpp diff --git a/src/gui/src/panels/timeline-panel.hpp b/src/gui/panels/timeline-panel.hpp similarity index 100% rename from src/gui/src/panels/timeline-panel.hpp rename to src/gui/panels/timeline-panel.hpp diff --git a/src/gui/src/panels/viewer-panel.cpp b/src/gui/panels/viewer-panel.cpp similarity index 100% rename from src/gui/src/panels/viewer-panel.cpp rename to src/gui/panels/viewer-panel.cpp diff --git a/src/gui/src/panels/viewer-panel.hpp b/src/gui/panels/viewer-panel.hpp similarity index 100% rename from src/gui/src/panels/viewer-panel.hpp rename to src/gui/panels/viewer-panel.hpp diff --git a/src/gui/src/Makefile.am b/src/gui/src/Makefile.am deleted file mode 100644 index 455dcdd60..000000000 --- a/src/gui/src/Makefile.am +++ /dev/null @@ -1,55 +0,0 @@ -## Process this file with automake to produce Makefile.in - -INCLUDES = \ - -DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \ - -DPACKAGE_SRC_DIR=\""$(srcdir)"\" \ - -DPACKAGE_DATA_DIR=\""$(datadir)"\" \ - $(GTK_LUMIERA_CFLAGS) - -AM_CFLAGS =\ - -Wall\ - -g - -bin_PROGRAMS = gtk-lumiera - -gtk_lumiera_SOURCES = \ - gtk-lumiera.cpp \ - gtk-lumiera.hpp \ - window-manager.cpp \ - window-manager.hpp \ - workspace/actions.cpp \ - workspace/actions.hpp \ - workspace/workspace-window.cpp \ - workspace/workspace-window.hpp \ - dialogs/render.cpp \ - dialogs/render.hpp \ - dialogs/preferences-dialog.cpp \ - dialogs/preferences-dialog.hpp \ - panels/panel.cpp \ - panels/panel.hpp \ - panels/timeline-panel.cpp \ - panels/timeline-panel.hpp \ - panels/viewer-panel.cpp \ - panels/viewer-panel.hpp \ - panels/assets-panel.cpp \ - panels/asset-panels.hpp \ - widgets/video-display-widget.cpp \ - widgets/video-display-widget.hpp \ - widgets/timeline-widget.cpp \ - widgets/timeline-widget.hpp \ - model/project.cpp \ - model/project.hpp \ - output/displayer.cpp \ - output/displayer.hpp \ - output/gdkdisplayer.cpp \ - output/gdkdisplayer.hpp \ - output/xvdisplayer.cpp \ - output/xvdisplayer.hpp - -gtk_lumiera_LDFLAGS = - -gtk_lumiera_LDADD = $(GTK_LUMIERA_LIBS) - -EXTRA_DIST = - - diff --git a/src/gui/src/widgets/timeline-widget.cpp b/src/gui/widgets/timeline-widget.cpp similarity index 100% rename from src/gui/src/widgets/timeline-widget.cpp rename to src/gui/widgets/timeline-widget.cpp diff --git a/src/gui/src/widgets/timeline-widget.hpp b/src/gui/widgets/timeline-widget.hpp similarity index 100% rename from src/gui/src/widgets/timeline-widget.hpp rename to src/gui/widgets/timeline-widget.hpp diff --git a/src/gui/src/widgets/video-display-widget.cpp b/src/gui/widgets/video-display-widget.cpp similarity index 100% rename from src/gui/src/widgets/video-display-widget.cpp rename to src/gui/widgets/video-display-widget.cpp diff --git a/src/gui/src/widgets/video-display-widget.hpp b/src/gui/widgets/video-display-widget.hpp similarity index 100% rename from src/gui/src/widgets/video-display-widget.hpp rename to src/gui/widgets/video-display-widget.hpp diff --git a/src/gui/src/window-manager.cpp b/src/gui/window-manager.cpp similarity index 100% rename from src/gui/src/window-manager.cpp rename to src/gui/window-manager.cpp diff --git a/src/gui/src/window-manager.hpp b/src/gui/window-manager.hpp similarity index 100% rename from src/gui/src/window-manager.hpp rename to src/gui/window-manager.hpp diff --git a/src/gui/src/workspace/actions.cpp b/src/gui/workspace/actions.cpp similarity index 100% rename from src/gui/src/workspace/actions.cpp rename to src/gui/workspace/actions.cpp diff --git a/src/gui/src/workspace/actions.hpp b/src/gui/workspace/actions.hpp similarity index 100% rename from src/gui/src/workspace/actions.hpp rename to src/gui/workspace/actions.hpp diff --git a/src/gui/src/workspace/workspace-window.cpp b/src/gui/workspace/workspace-window.cpp similarity index 99% rename from src/gui/src/workspace/workspace-window.cpp rename to src/gui/workspace/workspace-window.cpp index 66d74e905..c203c7584 100644 --- a/src/gui/src/workspace/workspace-window.cpp +++ b/src/gui/workspace/workspace-window.cpp @@ -32,7 +32,7 @@ #include #include -#include "gtk-lumiera.hpp" +#include "../gtk-lumiera.hpp" #include "workspace-window.hpp" using namespace Gtk; diff --git a/src/gui/src/workspace/workspace-window.hpp b/src/gui/workspace/workspace-window.hpp similarity index 100% rename from src/gui/src/workspace/workspace-window.hpp rename to src/gui/workspace/workspace-window.hpp From 4c9eea2c73eb18e56d5916a3f93c9c23700b2558 Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Wed, 14 May 2008 22:02:02 +0100 Subject: [PATCH 038/110] Modified Makefile.am to test lumiera_gui.rc copying failure --- src/gui/Makefile.am | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/gui/Makefile.am b/src/gui/Makefile.am index 818c2f582..c54cd2efb 100644 --- a/src/gui/Makefile.am +++ b/src/gui/Makefile.am @@ -70,7 +70,9 @@ lumigui_SOURCES = \ lumigui_LDFLAGS = lumigui_LDADD = $(GTK_LUMIERA_LIBS) -themesdir = $(datadir)/themes -themes_DATA = $(lumigui_srcdir)/lumiera_ui.rc +$(top_builddir)/lumiera_ui.rc: + echo TEST TEST + exit 1 + +#cp $(lumigui_srcdir)/lumiera_ui.rc $(top_builddir) -EXTRA_DIST += $(themes_DATA) From 0b70cf132a7403eeaaf159b895d37465fe43b2eb Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Wed, 14 May 2008 22:29:05 +0100 Subject: [PATCH 039/110] Copying lumiera_gui.rc now works --- src/gui/Makefile.am | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/gui/Makefile.am b/src/gui/Makefile.am index c54cd2efb..6fcc0a5a3 100644 --- a/src/gui/Makefile.am +++ b/src/gui/Makefile.am @@ -70,9 +70,7 @@ lumigui_SOURCES = \ lumigui_LDFLAGS = lumigui_LDADD = $(GTK_LUMIERA_LIBS) +lumigui_DEPENDENCIES = $(top_builddir)/lumiera_ui.rc $(top_builddir)/lumiera_ui.rc: - echo TEST TEST - exit 1 - -#cp $(lumigui_srcdir)/lumiera_ui.rc $(top_builddir) + cp $(lumigui_srcdir)/lumiera_ui.rc $(top_builddir) From 1d89341fa42c63fe79ba9054a1198786b9b6afe8 Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Wed, 14 May 2008 22:50:53 +0100 Subject: [PATCH 040/110] Removed a couple of redundant files --- src/gui/autogen.sh | 159 ------------------------------------------- src/gui/configure.ac | 77 --------------------- 2 files changed, 236 deletions(-) delete mode 100755 src/gui/autogen.sh delete mode 100644 src/gui/configure.ac diff --git a/src/gui/autogen.sh b/src/gui/autogen.sh deleted file mode 100755 index 5e54fc413..000000000 --- a/src/gui/autogen.sh +++ /dev/null @@ -1,159 +0,0 @@ -#!/bin/sh -# Run this to generate all the initial makefiles, etc. - -srcdir=`dirname $0` -test -z "$srcdir" && srcdir=. - -DIE=0 - -if [ -n "$GNOME2_DIR" ]; then - ACLOCAL_FLAGS="-I $GNOME2_DIR/share/aclocal $ACLOCAL_FLAGS" - LD_LIBRARY_PATH="$GNOME2_DIR/lib:$LD_LIBRARY_PATH" - PATH="$GNOME2_DIR/bin:$PATH" - export PATH - export LD_LIBRARY_PATH -fi - -(test -f $srcdir/configure.ac) || { - echo -n "**Error**: Directory "\`$srcdir\'" does not look like the" - echo " top-level package directory" - exit 1 -} - -(autoconf --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "**Error**: You must have \`autoconf' installed." - echo "Download the appropriate package for your distribution," - echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" - DIE=1 -} - -(grep "^IT_PROG_INTLTOOL" $srcdir/configure.ac >/dev/null) && { - (intltoolize --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "**Error**: You must have \`intltool' installed." - echo "You can get it from:" - echo " ftp://ftp.gnome.org/pub/GNOME/" - DIE=1 - } -} - -(grep "^AM_PROG_XML_I18N_TOOLS" $srcdir/configure.ac >/dev/null) && { - (xml-i18n-toolize --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "**Error**: You must have \`xml-i18n-toolize' installed." - echo "You can get it from:" - echo " ftp://ftp.gnome.org/pub/GNOME/" - DIE=1 - } -} - -(grep "^AM_PROG_LIBTOOL" $srcdir/configure.ac >/dev/null) && { - (libtool --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "**Error**: You must have \`libtool' installed." - echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/" - DIE=1 - } -} - -(grep "^AM_GLIB_GNU_GETTEXT" $srcdir/configure.ac >/dev/null) && { - (grep "sed.*POTFILES" $srcdir/configure.ac) > /dev/null || \ - (glib-gettextize --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "**Error**: You must have \`glib' installed." - echo "You can get it from: ftp://ftp.gtk.org/pub/gtk" - DIE=1 - } -} - -(automake --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "**Error**: You must have \`automake' installed." - echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/" - DIE=1 - NO_AUTOMAKE=yes -} - - -# if no automake, don't bother testing for aclocal -test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "**Error**: Missing \`aclocal'. The version of \`automake'" - echo "installed doesn't appear recent enough." - echo "You can get automake from ftp://ftp.gnu.org/pub/gnu/" - DIE=1 -} - -if test "$DIE" -eq 1; then - exit 1 -fi - -if test -z "$*"; then - echo "**Warning**: I am going to run \`configure' with no arguments." - echo "If you wish to pass any to it, please specify them on the" - echo \`$0\'" command line." - echo -fi - -case $CC in -xlc ) - am_opt=--include-deps;; -esac - -for coin in `find $srcdir -path $srcdir/CVS -prune -o -name configure.ac -print` -do - dr=`dirname $coin` - if test -f $dr/NO-AUTO-GEN; then - echo skipping $dr -- flagged as no auto-gen - else - echo processing $dr - ( cd $dr - - aclocalinclude="$ACLOCAL_FLAGS" - - if grep "^AM_GLIB_GNU_GETTEXT" configure.ac >/dev/null; then - echo "Creating $dr/aclocal.m4 ..." - test -r $dr/aclocal.m4 || touch $dr/aclocal.m4 - echo "Running glib-gettextize... Ignore non-fatal messages." - echo "no" | glib-gettextize --force --copy - echo "Making $dr/aclocal.m4 writable ..." - test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4 - fi - if grep "^IT_PROG_INTLTOOL" configure.ac >/dev/null; then - echo "Running intltoolize..." - intltoolize --copy --force --automake - fi - if grep "^AM_PROG_XML_I18N_TOOLS" configure.ac >/dev/null; then - echo "Running xml-i18n-toolize..." - xml-i18n-toolize --copy --force --automake - fi - if grep "^AM_PROG_LIBTOOL" configure.ac >/dev/null; then - if test -z "$NO_LIBTOOLIZE" ; then - echo "Running libtoolize..." - libtoolize --force --copy - fi - fi - echo "Running aclocal $aclocalinclude ..." - aclocal $aclocalinclude - if grep "^AM_CONFIG_HEADER" configure.ac >/dev/null; then - echo "Running autoheader..." - autoheader - fi - echo "Running automake --foreign $am_opt ..." - automake --add-missing --foreign $am_opt - echo "Running autoconf ..." - autoconf - ) - fi -done - -conf_flags="--enable-maintainer-mode" - -if test x$NOCONFIGURE = x; then - echo Running $srcdir/configure $conf_flags "$@" ... - $srcdir/configure $conf_flags "$@" \ - && echo Now type \`make\' to compile. || exit 1 -else - echo Skipping configure process. -fi diff --git a/src/gui/configure.ac b/src/gui/configure.ac deleted file mode 100644 index 2e3a7cd21..000000000 --- a/src/gui/configure.ac +++ /dev/null @@ -1,77 +0,0 @@ -dnl Process this file with autoconf to produce a configure script. - -AC_INIT(gtk-lumiera, 0.1) - -AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) -AM_CONFIG_HEADER(config.h) -AM_MAINTAINER_MODE - -AC_ISC_POSIX -AC_PROG_CXX -AM_PROG_CC_STDC -AC_HEADER_STDC - - - - -dnl *************************************************************************** -dnl Internatinalization -dnl *************************************************************************** -GETTEXT_PACKAGE=gtk-lumiera -AC_SUBST(GETTEXT_PACKAGE) -AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [GETTEXT package name]) -AM_GLIB_GNU_GETTEXT -IT_PROG_INTLTOOL([0.35.0]) - - - -AM_PROG_LIBTOOL - - -# ###################################################################### -# Checks for X11 and XVideo -# ###################################################################### -AC_PATH_X -AC_PATH_XTRA -# CFLAGS="$CFLAGS $X_CFLAGS" -LIBS="$LIBS $X_PRE_LIBS $X_LIBS $X_EXTRA_LIBS" - -AC_CHECK_HEADERS([X11/Xlib.h X11/Xutil.h],[], - [AC_MSG_ERROR([Xlib.h or Xutil.h not found install xdevel])]) - -# OK, this is confusing. The old tests test for the existence of a number -# of header files, and add -lXv to the linker flags if they are there. -# However, if they are _not_ there, only a warning is issued, but -# src/displayer.h includes these unconditionally. -# I conclude that -lXv _is_ required. If not, src/displayer.h should be edited, -# I think. -# This test requires libXv and, therefore, libXext - -AC_CHECK_HEADERS([sys/ipc.h sys/shm.h],, - [AC_MSG_ERROR([Required header not found. Please check that it is installed])] -) -AC_CHECK_HEADERS([X11/extensions/Xvlib.h X11/extensions/XShm.h],, - [AC_MSG_ERROR([Required xvideo (Xv) extension to X not found. Please check that it is installed.])], - [#include ] -) - -AC_CHECK_LIB(Xext, XInitExtension, , - [AC_MSG_ERROR([Could not link with libXext. Check that you have libXext installed])], -lX11 -) -AC_CHECK_LIB(Xv, XvQueryAdaptors, , - [AC_MSG_ERROR([Could not link with libXv. Check that you have libXv installed])] -) - -# ###################################################################### -# Checks for GTK stuff -# ###################################################################### -PKG_CHECK_MODULES(GTK_LUMIERA, [gtkmm-2.4 >= 2.8 gdl-1.0 >= 0.6.1 cairomm-1.0 >= 0.6.0]) - -AC_SUBST(GTK_LUMIERA_CFLAGS) -AC_SUBST(GTK_LUMIERA_LIBS) - -AC_OUTPUT([ -Makefile -src/Makefile -po/Makefile.in -]) From 41d5ff9610a81a3da5850b1bfeff5d394e6155bf Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Thu, 15 May 2008 00:04:10 +0100 Subject: [PATCH 041/110] Added an icon to the viewer panel --- src/gui/Makefile.am | 8 ++++++- src/gui/panels/panel.cpp | 16 ++++++++++++-- src/gui/panels/panel.hpp | 9 ++++++++ src/gui/panels/viewer-panel.cpp | 2 +- src/gui/workspace/actions.cpp | 39 ++++++++++++++++++++++++++++++++- src/gui/workspace/actions.hpp | 11 ++++++++-- 6 files changed, 78 insertions(+), 7 deletions(-) diff --git a/src/gui/Makefile.am b/src/gui/Makefile.am index 6fcc0a5a3..ff02570bd 100644 --- a/src/gui/Makefile.am +++ b/src/gui/Makefile.am @@ -70,7 +70,13 @@ lumigui_SOURCES = \ lumigui_LDFLAGS = lumigui_LDADD = $(GTK_LUMIERA_LIBS) -lumigui_DEPENDENCIES = $(top_builddir)/lumiera_ui.rc +lumigui_DEPENDENCIES = \ + $(top_builddir)/lumiera_ui.rc \ + $(top_builddir)/viewer-panel.png + $(top_builddir)/lumiera_ui.rc: cp $(lumigui_srcdir)/lumiera_ui.rc $(top_builddir) +$(top_builddir)/viewer-panel.png: + cp $(top_srcdir)/icons/viewer-panel.png $(top_builddir) + diff --git a/src/gui/panels/panel.cpp b/src/gui/panels/panel.cpp index 67ac1fd3f..efe3f3b38 100644 --- a/src/gui/panels/panel.cpp +++ b/src/gui/panels/panel.cpp @@ -29,8 +29,14 @@ namespace panels { Panel::Panel(const gchar *name, const gchar *long_name, GdlDockItemBehavior behavior) { dock_item = (GdlDockItem*)gdl_dock_item_new (name, long_name, behavior); - gtk_container_add ((GtkContainer*)dock_item, (GtkWidget*)gobj()); - gtk_widget_show ((GtkWidget*)dock_item); + internal_setup(); +} + +Panel::Panel(const gchar *name, const gchar *long_name, const gchar *stock_id, + GdlDockItemBehavior behavior) +{ + dock_item = (GdlDockItem*)gdl_dock_item_new_with_stock (name, long_name, stock_id, behavior); + internal_setup(); } Panel::~Panel() @@ -43,6 +49,12 @@ GdlDockItem* Panel::get_dock_item() const return dock_item; } +void Panel::internal_setup() +{ + gtk_container_add ((GtkContainer*)dock_item, (GtkWidget*)gobj()); + gtk_widget_show ((GtkWidget*)dock_item); +} + } // namespace panels } // namespace gui } // namespace lumiera diff --git a/src/gui/panels/panel.hpp b/src/gui/panels/panel.hpp index 05cc47dc6..05e180e77 100644 --- a/src/gui/panels/panel.hpp +++ b/src/gui/panels/panel.hpp @@ -40,13 +40,22 @@ namespace panels { class Panel : public Gtk::VBox { protected: + Panel(const gchar *name, const gchar *long_name, GdlDockItemBehavior behavior = GDL_DOCK_ITEM_BEH_NORMAL); + Panel(const gchar *name, const gchar *long_name, const gchar *stock_id, + GdlDockItemBehavior behavior = GDL_DOCK_ITEM_BEH_NORMAL); ~Panel(); public: GdlDockItem* get_dock_item() const; + private: + /** + * The internal constructor for this class, whose purpose + * is to set up the internal container widgets. + */ + void internal_setup(); protected: GdlDockItem* dock_item; diff --git a/src/gui/panels/viewer-panel.cpp b/src/gui/panels/viewer-panel.cpp index ea1bfeffd..c5a64f781 100644 --- a/src/gui/panels/viewer-panel.cpp +++ b/src/gui/panels/viewer-panel.cpp @@ -30,7 +30,7 @@ namespace gui { namespace panels { ViewerPanel::ViewerPanel() : - Panel("viewer", "Viewer"), + Panel("viewer", "Viewer", "viewer_panel"), previousButton(Stock::MEDIA_PREVIOUS), rewindButton(Stock::MEDIA_REWIND), playPauseButton(Stock::MEDIA_PLAY), diff --git a/src/gui/workspace/actions.cpp b/src/gui/workspace/actions.cpp index 6d69a8e6a..389c0059a 100644 --- a/src/gui/workspace/actions.cpp +++ b/src/gui/workspace/actions.cpp @@ -38,6 +38,8 @@ namespace workspace { Actions::Actions(WorkspaceWindow &workspace_window) : workspaceWindow(workspace_window) { + register_stock_items(); + actionGroup = ActionGroup::create(); // File menu @@ -63,7 +65,7 @@ namespace workspace { // View Menu actionGroup->add(Action::create("ViewMenu", _("_View"))); - actionGroup->add(Action::create("ViewViewer", _("_Viewer")), + actionGroup->add(Action::create("ViewViewer", Gtk::StockID("viewer_panel")), sigc::mem_fun(*this, &Actions::on_menu_view_viewer)); actionGroup->add(Action::create("ViewTimeline", _("_Timeline")), sigc::mem_fun(*this, &Actions::on_menu_view_timeline)); @@ -74,6 +76,41 @@ namespace workspace { sigc::mem_fun(*this, &Actions::on_menu_help_about) ); } + void + Actions::register_stock_items() + { + RefPtr factory = IconFactory::create(); + add_stock_item(factory, "viewer-panel.png", "viewer_panel", _("_Viewer")); + factory->add_default(); //Add factory to list of factories. + } + + void + Actions::add_stock_item(const Glib::RefPtr& factory, + const Glib::ustring& filepath, + const Glib::ustring& id, const Glib::ustring& label) + { + Gtk::IconSource source; + try + { + //This throws an exception if the file is not found: + source.set_pixbuf( Gdk::Pixbuf::create_from_file(filepath) ); + } + catch(const Glib::Exception& ex) + { + g_message(ex.what().c_str()); + } + + source.set_size(Gtk::ICON_SIZE_SMALL_TOOLBAR); + source.set_size_wildcarded(); //Icon may be scaled. + + Gtk::IconSet icon_set; + icon_set.add_source(source); //More than one source per set is allowed. + + const Gtk::StockID stock_id(id); + factory->add(stock_id, icon_set); + Gtk::Stock::add(Gtk::StockItem(stock_id, label)); + } + /* ===== File Menu Event Handlers ===== */ void diff --git a/src/gui/workspace/actions.hpp b/src/gui/workspace/actions.hpp index 5ec50c33a..9b9092250 100644 --- a/src/gui/workspace/actions.hpp +++ b/src/gui/workspace/actions.hpp @@ -46,12 +46,19 @@ class WorkspaceWindow; private: Actions(WorkspaceWindow &workspace_window); + void register_stock_items(); + + void add_stock_item(const Glib::RefPtr& factory, + const Glib::ustring& filepath, + const Glib::ustring& id, const Glib::ustring& label); + /** - * A reference to the MainWindow which owns - * this helper */ + * A reference to the MainWindow which owns + * this helper */ WorkspaceWindow &workspaceWindow; /* ===== Event Handlers ===== */ + private: void on_menu_file_new_project(); void on_menu_file_open_project(); void on_menu_file_render(); From fdbdfe2493d7d109099a7d2455dfdf54f2f2a4ad Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Fri, 16 May 2008 18:49:32 +0100 Subject: [PATCH 042/110] Added an icon for the timeline --- icons/timeline-panel.png | Bin 0 -> 447 bytes icons/timeline-panel.svg | 415 ++++++++++++++++++++++++++++++ src/gui/Makefile.am | 6 +- src/gui/panels/timeline-panel.cpp | 2 +- src/gui/workspace/actions.cpp | 3 +- 5 files changed, 423 insertions(+), 3 deletions(-) create mode 100644 icons/timeline-panel.png create mode 100644 icons/timeline-panel.svg diff --git a/icons/timeline-panel.png b/icons/timeline-panel.png new file mode 100644 index 0000000000000000000000000000000000000000..91bf10a962e7fd33e70a5eadfe8db1f796294e16 GIT binary patch literal 447 zcmV;w0YLtVP)CRRU+^Y6#W6gA!-nZ zi-OdkM&cq4;b=oY!ru_q(h@|_)DlG?-0%Cm=iCOhv`Mk0122d7;heLabG$f?StR_0 zy8mK;cX)J=R@JhoW>ghbMI;{PvH!(KtgEWkL@Kp|h#(?FksuO%`yV!`Xo~p&C&#A% z6!HZCia`m0v+_9rwMq?uM!f+*tJwmeebvUhDPE^TW6Q?aOlT~jvGh0I*=CE-Sj>op z#`3cA#Qxgen0G^CtG;yuoEtFC&J6&VmHU&%js!3(_lMIR);Zir + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + diff --git a/src/gui/Makefile.am b/src/gui/Makefile.am index ff02570bd..5ea08b2a8 100644 --- a/src/gui/Makefile.am +++ b/src/gui/Makefile.am @@ -72,7 +72,8 @@ lumigui_LDADD = $(GTK_LUMIERA_LIBS) lumigui_DEPENDENCIES = \ $(top_builddir)/lumiera_ui.rc \ - $(top_builddir)/viewer-panel.png + $(top_builddir)/viewer-panel.png \ + $(top_builddir)/timeline.png $(top_builddir)/lumiera_ui.rc: cp $(lumigui_srcdir)/lumiera_ui.rc $(top_builddir) @@ -80,3 +81,6 @@ $(top_builddir)/lumiera_ui.rc: $(top_builddir)/viewer-panel.png: cp $(top_srcdir)/icons/viewer-panel.png $(top_builddir) +$(top_builddir)/timeline.png: + cp $(top_srcdir)/icons/timeline.png $(top_builddir) + diff --git a/src/gui/panels/timeline-panel.cpp b/src/gui/panels/timeline-panel.cpp index 7d1de24ea..06e6187e0 100644 --- a/src/gui/panels/timeline-panel.cpp +++ b/src/gui/panels/timeline-panel.cpp @@ -27,7 +27,7 @@ namespace gui { namespace panels { TimelinePanel::TimelinePanel() : - Panel("timeline", "Timeline") + Panel("timeline", "Timeline", "timeline_panel") { pack_start(timeline_widget); } diff --git a/src/gui/workspace/actions.cpp b/src/gui/workspace/actions.cpp index 389c0059a..73c3d7983 100644 --- a/src/gui/workspace/actions.cpp +++ b/src/gui/workspace/actions.cpp @@ -67,7 +67,7 @@ namespace workspace { actionGroup->add(Action::create("ViewMenu", _("_View"))); actionGroup->add(Action::create("ViewViewer", Gtk::StockID("viewer_panel")), sigc::mem_fun(*this, &Actions::on_menu_view_viewer)); - actionGroup->add(Action::create("ViewTimeline", _("_Timeline")), + actionGroup->add(Action::create("ViewTimeline", Gtk::StockID("timeline_panel")), sigc::mem_fun(*this, &Actions::on_menu_view_timeline)); // Help Menu @@ -81,6 +81,7 @@ namespace workspace { { RefPtr factory = IconFactory::create(); add_stock_item(factory, "viewer-panel.png", "viewer_panel", _("_Viewer")); + add_stock_item(factory, "timeline-panel.png", "timeline_panel", _("_Timeline")); factory->add_default(); //Add factory to list of factories. } From a51d91d7b544cb4c89e10dfcc443c4768986e61b Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Fri, 16 May 2008 18:53:45 +0100 Subject: [PATCH 043/110] Corrected the makefile --- src/gui/Makefile.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/Makefile.am b/src/gui/Makefile.am index 5ea08b2a8..1373db120 100644 --- a/src/gui/Makefile.am +++ b/src/gui/Makefile.am @@ -81,6 +81,6 @@ $(top_builddir)/lumiera_ui.rc: $(top_builddir)/viewer-panel.png: cp $(top_srcdir)/icons/viewer-panel.png $(top_builddir) -$(top_builddir)/timeline.png: - cp $(top_srcdir)/icons/timeline.png $(top_builddir) +$(top_builddir)/timeline-panel.png: + cp $(top_srcdir)/icons/timeline-panel.png $(top_builddir) From 84374507671b5976728b83cd3246679cf65d9d59 Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Fri, 16 May 2008 19:23:12 +0100 Subject: [PATCH 044/110] More work on icons --- icons/assets-panel.png | Bin 0 -> 540 bytes icons/timeline-panel.png | Bin 447 -> 453 bytes icons/timeline-panel.svg | 116 ++++++++++++++++++------- src/gui/Makefile.am | 11 ++- src/gui/panels/assets-panel.cpp | 2 +- src/gui/workspace/actions.cpp | 20 +++-- src/gui/workspace/actions.hpp | 3 +- src/gui/workspace/workspace-window.cpp | 3 +- 8 files changed, 111 insertions(+), 44 deletions(-) create mode 100644 icons/assets-panel.png diff --git a/icons/assets-panel.png b/icons/assets-panel.png new file mode 100644 index 0000000000000000000000000000000000000000..9015426153054c0b529b4d9ebdfa06a221d568ac GIT binary patch literal 540 zcmV+%0^|LOP)Vhlm95D^5CAW0*NO~l4h2`Gn+SSXee3p=k!DITN| zloYWEXca63MGv(U^qPobY>b#9Dp8{0UEbTVcsUg#cu}XB*@6F?*_nZVGy!PT%rNk5 zliHE-nb49(%`}10vsV}N{rqDUTQ;Bo7$dnCNIoxON&^{bA}^laGjk880qPdu^yOBT zEWa_clc&Tx2f*4|8y`gof^!a2aQL`dICk+4OK+dE`@k5lTlYsTutSWPkfmY@o;2kB zMZE(6RQjtR27v0WeY98J5hzgEvJDN{um$>(l@Gjpa+{MEra-d|pH&4=2yN1juSixu z;fgT;7AQWtIU$FSo`duYWUHV7)eJ(4YRG+92Ww!@-u*n7y$)#60)BA&kYbGBD?sJP zdQc>%Uxr2wvM|?-q){`MfcjsaLA`SadgR1;mgk#Ysp6f7xO?jg<1;~QC+VXy zJ@MAA0M19>h5)Ouem$!j+riU-~Y#ZtnKd2kxFF@Gk?R(=ynaW?xnwCgX&&m z1weh}{RBYc~1N zGA7O*oifT}%9w~fR>s7?2Y-3;aJujVL0oXjajNBK73k}B;KvQl_cIQy_O^vU%iwh7GBIt60>v9C5h>osUt~*_02}r y%<5)VyWtw!X4V`zK0dj2EH^kL+?{a$pXnTgN1ipT4s-ed0000P-*3uG0(9{w|Al&c!yyx5owX{jGr2{XA_u-tgoO8T5j#(u9 zg}VP@fOmLwkXF^QsAg0ZRYfEo=CS|9N35%=)kG?_gNPs^M1PSW5`Ft0HmPWe`2Z)! zrvMc41ptac34pWmIRLdv4S+_y0YIzS0-$}>#=9wAr$b}Q#@I|~ETOUVH{RK1i_loi zh=s=Tvhu|K+TNIVLu0GHbpxCmFwV{m0GO5glg5q&Fe~?m(;e11+(_fXS-9U%ev)fu zVbc+G@+|Lq6jOr|FRRbwnpxh~UkN&S!sG{ydV{;@mRvK-i3y;K$M_os(%>V!Z07*qoM6N<$f{?POKmY&$ diff --git a/icons/timeline-panel.svg b/icons/timeline-panel.svg index f77c1c0a0..306f56c9b 100644 --- a/icons/timeline-panel.svg +++ b/icons/timeline-panel.svg @@ -14,7 +14,7 @@ id="svg2677" sodipodi:version="0.32" inkscape:version="0.46" - sodipodi:docname="timeline.svg" + sodipodi:docname="timeline-panel.svg" version="1.0" inkscape:output_extension="org.inkscape.output.svg.inkscape" inkscape:export-filename="/home/joel/workspace/lumiera/lumiera/icons/timeline.png" @@ -331,16 +331,84 @@ y1="9" x2="16" y2="9" /> + + + + + + + + id="mask2463"> + height="16" + x="0" + y="0" /> - + - - + d="M 0 4 L 0 5 L 0 6 L 0 10 L 0 11 L 0 12 L 16 12 L 16 11 L 15 11 L 15 10 L 16 10 L 16 6 L 15 6 L 15 5 L 16 5 L 16 4 L 0 4 z M 1 5 L 2 5 L 2 6 L 1 6 L 1 5 z M 3 5 L 4 5 L 4 6 L 3 6 L 3 5 z M 5 5 L 6 5 L 6 6 L 5 6 L 5 5 z M 7 5 L 8 5 L 8 6 L 7 6 L 7 5 z M 9 5 L 10 5 L 10 6 L 9 6 L 9 5 z M 11 5 L 12 5 L 12 6 L 11 6 L 11 5 z M 13 5 L 14 5 L 14 6 L 13 6 L 13 5 z M 1 10 L 2 10 L 2 11 L 1 11 L 1 10 z M 3 10 L 4 10 L 4 11 L 3 11 L 3 10 z M 5 10 L 6 10 L 6 11 L 5 11 L 5 10 z M 7 10 L 8 10 L 8 11 L 7 11 L 7 10 z M 9 10 L 10 10 L 10 11 L 9 11 L 9 10 z M 11 10 L 12 10 L 12 11 L 11 11 L 11 10 z M 13 10 L 14 10 L 14 11 L 13 11 L 13 10 z " + style="fill:url(#linearGradient2444);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none" /> + style="fill:url(#linearGradient2433);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none" /> add(Action::create("ViewMenu", _("_View"))); - actionGroup->add(Action::create("ViewViewer", Gtk::StockID("viewer_panel")), - sigc::mem_fun(*this, &Actions::on_menu_view_viewer)); + actionGroup->add(Action::create("ViewAssets", Gtk::StockID("assets_panel")), + sigc::mem_fun(*this, &Actions::on_menu_view_assets)); actionGroup->add(Action::create("ViewTimeline", Gtk::StockID("timeline_panel")), sigc::mem_fun(*this, &Actions::on_menu_view_timeline)); + actionGroup->add(Action::create("ViewViewer", Gtk::StockID("viewer_panel")), + sigc::mem_fun(*this, &Actions::on_menu_view_viewer)); + // Help Menu actionGroup->add(Action::create("HelpMenu", _("_Help")) ); @@ -80,8 +83,9 @@ namespace workspace { Actions::register_stock_items() { RefPtr factory = IconFactory::create(); - add_stock_item(factory, "viewer-panel.png", "viewer_panel", _("_Viewer")); + add_stock_item(factory, "assets-panel.png", "assets_panel", _("_Assets")); add_stock_item(factory, "timeline-panel.png", "timeline_panel", _("_Timeline")); + add_stock_item(factory, "viewer-panel.png", "viewer_panel", _("_Viewer")); factory->add_default(); //Add factory to list of factories. } @@ -147,9 +151,9 @@ namespace workspace { } void - Actions::on_menu_view_viewer() + Actions::on_menu_view_assets() { - //workspaceWindow.viewer_panel.show(); + //workspaceWindow.timeline_panel.show(); } void @@ -158,6 +162,12 @@ namespace workspace { //workspaceWindow.timeline_panel.show(); } + void + Actions::on_menu_view_viewer() + { + //workspaceWindow.viewer_panel.show(); + } + void Actions::on_menu_help_about() { diff --git a/src/gui/workspace/actions.hpp b/src/gui/workspace/actions.hpp index 9b9092250..1c2c2ff05 100644 --- a/src/gui/workspace/actions.hpp +++ b/src/gui/workspace/actions.hpp @@ -66,8 +66,9 @@ class WorkspaceWindow; void on_menu_edit_preferences(); - void on_menu_view_viewer(); + void on_menu_view_assets(); void on_menu_view_timeline(); + void on_menu_view_viewer(); void on_menu_help_about(); diff --git a/src/gui/workspace/workspace-window.cpp b/src/gui/workspace/workspace-window.cpp index c203c7584..c2c46d61b 100644 --- a/src/gui/workspace/workspace-window.cpp +++ b/src/gui/workspace/workspace-window.cpp @@ -91,8 +91,9 @@ namespace workspace { " " " " " " - " " + " " " " + " " " " " " " " From df5c40fd6302397d90a82b57353ed449873e272a Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Sat, 17 May 2008 11:20:49 +0100 Subject: [PATCH 045/110] Panels can now be show and hidden More documentation added to Panel --- src/gui/panels/assets-panel.cpp | 2 +- src/gui/panels/panel.cpp | 21 ++++++++++++--- src/gui/panels/panel.hpp | 31 +++++++++++++++++++++- src/gui/panels/timeline-panel.cpp | 2 +- src/gui/panels/viewer-panel.cpp | 2 +- src/gui/workspace/actions.cpp | 44 ++++++++++++++++++++++++------- src/gui/workspace/actions.hpp | 21 ++++++++++++--- 7 files changed, 104 insertions(+), 19 deletions(-) diff --git a/src/gui/panels/assets-panel.cpp b/src/gui/panels/assets-panel.cpp index 81d449ffb..47aeb5379 100644 --- a/src/gui/panels/assets-panel.cpp +++ b/src/gui/panels/assets-panel.cpp @@ -27,7 +27,7 @@ namespace gui { namespace panels { AssetsPanel::AssetsPanel() : - Panel("assets", "Assets", "assets_panel"), + Panel("assets", _("Assets"), "assets_panel"), placeholder("Placeholder label. Is this supposed to be titled assets\nas in the proc layer? or resources\nas in cinelerra?") { pack_start(placeholder); diff --git a/src/gui/panels/panel.cpp b/src/gui/panels/panel.cpp index efe3f3b38..81dbf9092 100644 --- a/src/gui/panels/panel.cpp +++ b/src/gui/panels/panel.cpp @@ -41,15 +41,30 @@ Panel::Panel(const gchar *name, const gchar *long_name, const gchar *stock_id, Panel::~Panel() { - + #warning Im not sure that dock_item is freed - is it self deleting? } -GdlDockItem* Panel::get_dock_item() const +GdlDockItem* +Panel::get_dock_item() const { return dock_item; } -void Panel::internal_setup() +void +Panel::show(bool show) +{ + if(show) gdl_dock_item_show_item (dock_item); + else gdl_dock_item_hide_item (dock_item); +} + +bool +Panel::is_shown() const +{ + return GTK_WIDGET_VISIBLE((GtkWidget*)dock_item); +} + +void +Panel::internal_setup() { gtk_container_add ((GtkContainer*)dock_item, (GtkWidget*)gobj()); gtk_widget_show ((GtkWidget*)dock_item); diff --git a/src/gui/panels/panel.hpp b/src/gui/panels/panel.hpp index 05e180e77..6769f32d7 100644 --- a/src/gui/panels/panel.hpp +++ b/src/gui/panels/panel.hpp @@ -40,18 +40,47 @@ namespace panels { class Panel : public Gtk::VBox { protected: - + /** + * Constructs a panel object + * @param name The internal name of this panel + * @param long_name The name to display on the caption + * @param behavior The GDL behaviour of this item + */ Panel(const gchar *name, const gchar *long_name, GdlDockItemBehavior behavior = GDL_DOCK_ITEM_BEH_NORMAL); + + /** + * Constructs a panel object with a stock item for a caption + * @param name The internal name of this panel + * @param long_name The name to display on the caption + * @param stock_id The id of the stock item to display on the caption + * @param behavior The GDL behaviour of this item + */ Panel(const gchar *name, const gchar *long_name, const gchar *stock_id, GdlDockItemBehavior behavior = GDL_DOCK_ITEM_BEH_NORMAL); + ~Panel(); public: + /** + * Returns a pointer to the underlying GdlDockItem structure + */ GdlDockItem* get_dock_item() const; + /** + * Shows or hides the panel. + * @param show A value of true will show the panel, + * false will hide it. */ + void show(bool show = true); + + /** + * Returns true if the panel is currently visible. + */ + bool is_shown() const; + private: /** + * @internal Used by both constructors * The internal constructor for this class, whose purpose * is to set up the internal container widgets. */ diff --git a/src/gui/panels/timeline-panel.cpp b/src/gui/panels/timeline-panel.cpp index 06e6187e0..a7a8b2b46 100644 --- a/src/gui/panels/timeline-panel.cpp +++ b/src/gui/panels/timeline-panel.cpp @@ -27,7 +27,7 @@ namespace gui { namespace panels { TimelinePanel::TimelinePanel() : - Panel("timeline", "Timeline", "timeline_panel") + Panel("timeline", _("Timeline"), "timeline_panel") { pack_start(timeline_widget); } diff --git a/src/gui/panels/viewer-panel.cpp b/src/gui/panels/viewer-panel.cpp index c5a64f781..223d1a572 100644 --- a/src/gui/panels/viewer-panel.cpp +++ b/src/gui/panels/viewer-panel.cpp @@ -30,7 +30,7 @@ namespace gui { namespace panels { ViewerPanel::ViewerPanel() : - Panel("viewer", "Viewer", "viewer_panel"), + Panel("viewer", _("Viewer"), "viewer_panel"), previousButton(Stock::MEDIA_PREVIOUS), rewindButton(Stock::MEDIA_REWIND), playPauseButton(Stock::MEDIA_PLAY), diff --git a/src/gui/workspace/actions.cpp b/src/gui/workspace/actions.cpp index bb1c75a35..0e939f356 100644 --- a/src/gui/workspace/actions.cpp +++ b/src/gui/workspace/actions.cpp @@ -65,18 +65,29 @@ namespace workspace { // View Menu actionGroup->add(Action::create("ViewMenu", _("_View"))); - actionGroup->add(Action::create("ViewAssets", Gtk::StockID("assets_panel")), - sigc::mem_fun(*this, &Actions::on_menu_view_assets)); - actionGroup->add(Action::create("ViewTimeline", Gtk::StockID("timeline_panel")), - sigc::mem_fun(*this, &Actions::on_menu_view_timeline)); - actionGroup->add(Action::create("ViewViewer", Gtk::StockID("viewer_panel")), - sigc::mem_fun(*this, &Actions::on_menu_view_viewer)); + + assetsPanelAction = ToggleAction::create("ViewAssets", Gtk::StockID("assets_panel")); + assetsPanelAction->signal_toggled().connect( + sigc::mem_fun(*this, &Actions::on_menu_view_assets)); + actionGroup->add(assetsPanelAction); + + timelinePanelAction = ToggleAction::create("ViewTimeline", Gtk::StockID("timeline_panel")); + timelinePanelAction->signal_toggled().connect( + sigc::mem_fun(*this, &Actions::on_menu_view_timeline)); + actionGroup->add(timelinePanelAction); + viewerPanelAction = ToggleAction::create("ViewViewer", Gtk::StockID("viewer_panel")); + viewerPanelAction->signal_toggled().connect( + sigc::mem_fun(*this, &Actions::on_menu_view_viewer)); + actionGroup->add(viewerPanelAction); // Help Menu actionGroup->add(Action::create("HelpMenu", _("_Help")) ); actionGroup->add(Action::create("HelpAbout", Stock::ABOUT), sigc::mem_fun(*this, &Actions::on_menu_help_about) ); + + // Refresh the UI state + update_action_state(); } void @@ -116,6 +127,14 @@ namespace workspace { Gtk::Stock::add(Gtk::StockItem(stock_id, label)); } + void + Actions::update_action_state() + { + assetsPanelAction->set_active(workspaceWindow.assets_panel.is_shown()); + timelinePanelAction->set_active(workspaceWindow.timeline_panel.is_shown()); + viewerPanelAction->set_active(workspaceWindow.viewer_panel.is_shown()); + } + /* ===== File Menu Event Handlers ===== */ void @@ -143,6 +162,8 @@ namespace workspace { workspaceWindow.hide(); // Closes the main window to stop the Gtk::Main::run(). } + /* ===== Edit Menu Event Handlers ===== */ + void Actions::on_menu_edit_preferences() { @@ -150,22 +171,27 @@ namespace workspace { dialog.run(); } + /* ===== View Menu Event Handlers ===== */ + void Actions::on_menu_view_assets() { - //workspaceWindow.timeline_panel.show(); + workspaceWindow.assets_panel.show(!workspaceWindow.assets_panel.is_shown()); + update_action_state(); } void Actions::on_menu_view_timeline() { - //workspaceWindow.timeline_panel.show(); + workspaceWindow.timeline_panel.show(!workspaceWindow.timeline_panel.is_shown()); + update_action_state(); } void Actions::on_menu_view_viewer() { - //workspaceWindow.viewer_panel.show(); + workspaceWindow.viewer_panel.show(!workspaceWindow.viewer_panel.is_shown()); + update_action_state(); } void diff --git a/src/gui/workspace/actions.hpp b/src/gui/workspace/actions.hpp index 1c2c2ff05..c68ce8de4 100644 --- a/src/gui/workspace/actions.hpp +++ b/src/gui/workspace/actions.hpp @@ -46,12 +46,22 @@ class WorkspaceWindow; private: Actions(WorkspaceWindow &workspace_window); - void register_stock_items(); + /* ===== Internals ===== */ + private: + /** + * Registers application stock items: icons and + * labels associated with IDs */ + static void register_stock_items(); - void add_stock_item(const Glib::RefPtr& factory, + static void add_stock_item(const Glib::RefPtr& factory, const Glib::ustring& filepath, const Glib::ustring& id, const Glib::ustring& label); + /** + * Updates the state of the menu/toolbar actions + * to reflect the current state of the workspace */ + void update_action_state(); + /** * A reference to the MainWindow which owns * this helper */ @@ -75,9 +85,14 @@ class WorkspaceWindow; // Temporary Junk void on_menu_others(); + /* ===== Actions ===== */ + private: Glib::RefPtr actionGroup; - Glib::RefPtr m_refChoiceOne, m_refChoiceTwo; + + Glib::RefPtr assetsPanelAction; + Glib::RefPtr timelinePanelAction; + Glib::RefPtr viewerPanelAction; friend class WorkspaceWindow; }; From 5f8c9a2a1259a7e34ba8b02037cfd7fec6739b63 Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Sat, 17 May 2008 18:12:07 +0100 Subject: [PATCH 046/110] Corrected 3 build errors --- src/gui/panels/assets-panel.cpp | 1 + src/gui/panels/timeline-panel.cpp | 1 + src/gui/panels/viewer-panel.cpp | 1 + 3 files changed, 3 insertions(+) diff --git a/src/gui/panels/assets-panel.cpp b/src/gui/panels/assets-panel.cpp index 47aeb5379..431b92019 100644 --- a/src/gui/panels/assets-panel.cpp +++ b/src/gui/panels/assets-panel.cpp @@ -20,6 +20,7 @@ * *****************************************************/ +#include "../gtk-lumiera.hpp" #include "assets-panel.hpp" namespace lumiera { diff --git a/src/gui/panels/timeline-panel.cpp b/src/gui/panels/timeline-panel.cpp index a7a8b2b46..f2a29fd61 100644 --- a/src/gui/panels/timeline-panel.cpp +++ b/src/gui/panels/timeline-panel.cpp @@ -20,6 +20,7 @@ * *****************************************************/ +#include "../gtk-lumiera.hpp" #include "timeline-panel.hpp" namespace lumiera { diff --git a/src/gui/panels/viewer-panel.cpp b/src/gui/panels/viewer-panel.cpp index 223d1a572..ff64138ed 100644 --- a/src/gui/panels/viewer-panel.cpp +++ b/src/gui/panels/viewer-panel.cpp @@ -20,6 +20,7 @@ * *****************************************************/ +#include "../gtk-lumiera.hpp" #include "viewer-panel.hpp" using namespace lumiera::gui::widgets; From fe975a701d1a3e6d8b120b850b772e06684cad86 Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Thu, 22 May 2008 19:19:04 +0100 Subject: [PATCH 047/110] Added some scroll bars --- src/gui/panels/timeline-panel.cpp | 4 +- src/gui/widgets/timeline-widget.cpp | 62 ++++++++++++++--------------- src/gui/widgets/timeline-widget.hpp | 14 +++++-- 3 files changed, 44 insertions(+), 36 deletions(-) diff --git a/src/gui/panels/timeline-panel.cpp b/src/gui/panels/timeline-panel.cpp index f2a29fd61..fc4e7387e 100644 --- a/src/gui/panels/timeline-panel.cpp +++ b/src/gui/panels/timeline-panel.cpp @@ -23,6 +23,8 @@ #include "../gtk-lumiera.hpp" #include "timeline-panel.hpp" +using namespace Gtk; + namespace lumiera { namespace gui { namespace panels { @@ -30,7 +32,7 @@ namespace panels { TimelinePanel::TimelinePanel() : Panel("timeline", _("Timeline"), "timeline_panel") { - pack_start(timeline_widget); + pack_start(timeline_widget, PACK_EXPAND_WIDGET); } } // namespace panels diff --git a/src/gui/widgets/timeline-widget.cpp b/src/gui/widgets/timeline-widget.cpp index 10eaa3fb0..4e60ba7b8 100644 --- a/src/gui/widgets/timeline-widget.cpp +++ b/src/gui/widgets/timeline-widget.cpp @@ -26,45 +26,43 @@ #include "timeline-widget.hpp" +using namespace Gtk; + namespace lumiera { namespace gui { namespace widgets { -TimelineWidget::TimelineWidget() +TimelineWidget::TimelineWidget() : + Table(2, 2), + horizontalAdjustment(0, 200, 400), + verticalAdjustment(0, 200, 400), + horizontalScroll(horizontalAdjustment), + verticalScroll(verticalAdjustment), + rowHeaderViewport(), + label1("label1"), label2("label2"), label3("label3"), label4("label4"), + label5("label5"), label6("label6"), label7("label7"), label8("label8"), + label9("label1"), label10("label10"), label11("label11"), ruler("ruler") { - set_flags(Gtk::NO_WINDOW); - } + rowHeaderBox.pack_start(label1); + rowHeaderBox.pack_start(label2); + rowHeaderBox.pack_start(label3); + rowHeaderBox.pack_start(label4); + rowHeaderBox.pack_start(label5); + rowHeaderBox.pack_start(label6); + rowHeaderBox.pack_start(label7); + rowHeaderBox.pack_start(label8); + rowHeaderBox.pack_start(label9); + rowHeaderBox.pack_start(label10); + rowHeaderBox.pack_start(label11); + rowHeaderViewport.add(rowHeaderBox); -void -TimelineWidget::on_realize() - { - //Call base class: - Gtk::Widget::on_realize(); + rowHeaderViewport.set_hadjustment(horizontalAdjustment); + rowHeaderViewport.set_vadjustment(verticalAdjustment); - } - -bool -TimelineWidget::on_expose_event(GdkEventExpose* event) - { - // This is where we draw on the window - Glib::RefPtr window = get_window(); - if(window) - { - /*Cairo::RefPtr cr = window->create_cairo_context(); - if(event) - { - // clip to the area that needs to be re-exposed so we don't draw any - // more than we need to. - cr->rectangle(event->area.x, event->area.y, - event->area.width, event->area.height); - cr->clip(); - } - - // Paint the background - cr->set_source_rgb(0.0, 0.0, 0.0); - cr->paint();*/ - } - return true; + attach(ruler, 1, 2, 0, 1, FILL|EXPAND, SHRINK); + attach(rowHeaderViewport, 0, 1, 1, 2, SHRINK, FILL|EXPAND); + attach(horizontalScroll, 1, 2, 2, 3, FILL|EXPAND, SHRINK); + attach(verticalScroll, 2, 3, 1, 2, SHRINK, FILL|EXPAND); } diff --git a/src/gui/widgets/timeline-widget.hpp b/src/gui/widgets/timeline-widget.hpp index a080d34b2..e89e684e0 100644 --- a/src/gui/widgets/timeline-widget.hpp +++ b/src/gui/widgets/timeline-widget.hpp @@ -32,15 +32,23 @@ namespace lumiera { namespace gui { namespace widgets { - class TimelineWidget : public Gtk::Widget + class TimelineWidget : public Gtk::Table { public: TimelineWidget(); /* ===== Overrides ===== */ protected: - virtual void on_realize(); - virtual bool on_expose_event(GdkEventExpose* event); + Gtk::Adjustment horizontalAdjustment, verticalAdjustment; + Gtk::HScrollbar horizontalScroll; + Gtk::VScrollbar verticalScroll; + + Gtk::Viewport rowHeaderViewport; + Gtk::VBox rowHeaderBox; + Gtk::Label label1, label2, label3, label4; + Gtk::Label label5, label6, label7, label8; + Gtk::Label label9, label10, label11, label12; + Gtk::Label ruler; }; } // namespace widgets From 7e2092825e25a3523ec229ac7edae6934f9be497 Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Sat, 31 May 2008 13:22:15 +0100 Subject: [PATCH 048/110] Simple scrolling and drawing added --- src/gui/Makefile.am | 78 ++++++++++--------- src/gui/widgets/timeline-widget.cpp | 88 +++++++++++++++------- src/gui/widgets/timeline-widget.hpp | 59 ++++++++++----- src/gui/widgets/timeline/timeline-body.cpp | 87 +++++++++++++++++++++ src/gui/widgets/timeline/timeline-body.hpp | 56 ++++++++++++++ src/gui/widgets/timeline/track.cpp | 51 +++++++++++++ src/gui/widgets/timeline/track.hpp | 59 +++++++++++++++ src/gui/widgets/timeline/video-track.cpp | 56 ++++++++++++++ src/gui/widgets/timeline/video-track.hpp | 57 ++++++++++++++ src/gui/widgets/video-display-widget.hpp | 1 + 10 files changed, 512 insertions(+), 80 deletions(-) create mode 100644 src/gui/widgets/timeline/timeline-body.cpp create mode 100644 src/gui/widgets/timeline/timeline-body.hpp create mode 100644 src/gui/widgets/timeline/track.cpp create mode 100644 src/gui/widgets/timeline/track.hpp create mode 100644 src/gui/widgets/timeline/video-track.cpp create mode 100644 src/gui/widgets/timeline/video-track.hpp diff --git a/src/gui/Makefile.am b/src/gui/Makefile.am index e056225fa..b498fa3e8 100644 --- a/src/gui/Makefile.am +++ b/src/gui/Makefile.am @@ -33,47 +33,53 @@ AM_CFLAGS =\ bin_PROGRAMS += lumigui -lumigui_SOURCES = \ - $(lumigui_srcdir)/gtk-lumiera.cpp \ - $(lumigui_srcdir)/gtk-lumiera.hpp \ - $(lumigui_srcdir)/window-manager.cpp \ - $(lumigui_srcdir)/window-manager.hpp \ - $(lumigui_srcdir)/workspace/actions.cpp \ - $(lumigui_srcdir)/workspace/actions.hpp \ - $(lumigui_srcdir)/workspace/workspace-window.cpp \ - $(lumigui_srcdir)/workspace/workspace-window.hpp \ - $(lumigui_srcdir)/dialogs/render.cpp \ - $(lumigui_srcdir)/dialogs/render.hpp \ - $(lumigui_srcdir)/dialogs/preferences-dialog.cpp \ - $(lumigui_srcdir)/dialogs/preferences-dialog.hpp \ - $(lumigui_srcdir)/panels/panel.cpp \ - $(lumigui_srcdir)/panels/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)/panels/assets-panel.cpp \ - $(lumigui_srcdir)/panels/asset-panels.hpp \ - $(lumigui_srcdir)/widgets/video-display-widget.cpp \ - $(lumigui_srcdir)/widgets/video-display-widget.hpp \ - $(lumigui_srcdir)/widgets/timeline-widget.cpp \ - $(lumigui_srcdir)/widgets/timeline-widget.hpp \ - $(lumigui_srcdir)/model/project.cpp \ - $(lumigui_srcdir)/model/project.hpp \ - $(lumigui_srcdir)/output/displayer.cpp \ - $(lumigui_srcdir)/output/displayer.hpp \ - $(lumigui_srcdir)/output/gdkdisplayer.cpp \ - $(lumigui_srcdir)/output/gdkdisplayer.hpp \ - $(lumigui_srcdir)/output/xvdisplayer.cpp \ +lumigui_SOURCES = \ + $(lumigui_srcdir)/gtk-lumiera.cpp \ + $(lumigui_srcdir)/gtk-lumiera.hpp \ + $(lumigui_srcdir)/window-manager.cpp \ + $(lumigui_srcdir)/window-manager.hpp \ + $(lumigui_srcdir)/workspace/actions.cpp \ + $(lumigui_srcdir)/workspace/actions.hpp \ + $(lumigui_srcdir)/workspace/workspace-window.cpp \ + $(lumigui_srcdir)/workspace/workspace-window.hpp \ + $(lumigui_srcdir)/dialogs/render.cpp \ + $(lumigui_srcdir)/dialogs/render.hpp \ + $(lumigui_srcdir)/dialogs/preferences-dialog.cpp \ + $(lumigui_srcdir)/dialogs/preferences-dialog.hpp \ + $(lumigui_srcdir)/panels/panel.cpp \ + $(lumigui_srcdir)/panels/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)/panels/assets-panel.cpp \ + $(lumigui_srcdir)/panels/asset-panels.hpp \ + $(lumigui_srcdir)/widgets/video-display-widget.cpp \ + $(lumigui_srcdir)/widgets/video-display-widget.hpp \ + $(lumigui_srcdir)/widgets/timeline-widget.cpp \ + $(lumigui_srcdir)/widgets/timeline-widget.hpp \ + $(lumigui_srcdir)/widgets/timeline/track.cpp \ + $(lumigui_srcdir)/widgets/timeline/track.hpp \ + $(lumigui_srcdir)/widgets/timeline/video-track.cpp \ + $(lumigui_srcdir)/widgets/timeline/video-track.hpp \ + $(lumigui_srcdir)/widgets/timeline/timeline-body.cpp \ + $(lumigui_srcdir)/widgets/timeline/timeline-body.hpp \ + $(lumigui_srcdir)/model/project.cpp \ + $(lumigui_srcdir)/model/project.hpp \ + $(lumigui_srcdir)/output/displayer.cpp \ + $(lumigui_srcdir)/output/displayer.hpp \ + $(lumigui_srcdir)/output/gdkdisplayer.cpp \ + $(lumigui_srcdir)/output/gdkdisplayer.hpp \ + $(lumigui_srcdir)/output/xvdisplayer.cpp \ $(lumigui_srcdir)/output/xvdisplayer.hpp lumigui_LDFLAGS = lumigui_LDADD = $(GTK_LUMIERA_LIBS) -lumigui_DEPENDENCIES = \ - $(top_builddir)/lumiera_ui.rc \ - $(top_builddir)/assets-panel.png \ - $(top_builddir)/timeline-panel.png \ +lumigui_DEPENDENCIES = \ + $(top_builddir)/lumiera_ui.rc \ + $(top_builddir)/assets-panel.png \ + $(top_builddir)/timeline-panel.png \ $(top_builddir)/viewer-panel.png $(top_builddir)/lumiera_ui.rc: diff --git a/src/gui/widgets/timeline-widget.cpp b/src/gui/widgets/timeline-widget.cpp index 4e60ba7b8..3665ec98b 100644 --- a/src/gui/widgets/timeline-widget.cpp +++ b/src/gui/widgets/timeline-widget.cpp @@ -1,5 +1,5 @@ /* - timeline.cpp - Implementation of the timeline widget + timeline-widget.cpp - Implementation of the timeline widget Copyright (C) Lumiera.org 2008, Joel Holdsworth @@ -20,13 +20,11 @@ * *****************************************************/ -#include -#include -#include - #include "timeline-widget.hpp" using namespace Gtk; +using namespace std; +using namespace lumiera::gui::widgets::timeline; namespace lumiera { namespace gui { @@ -34,38 +32,76 @@ namespace widgets { TimelineWidget::TimelineWidget() : Table(2, 2), - horizontalAdjustment(0, 200, 400), - verticalAdjustment(0, 200, 400), + totalHeight(0), + horizontalAdjustment(0, 0, 0), + verticalAdjustment(0, 0, 0), horizontalScroll(horizontalAdjustment), verticalScroll(verticalAdjustment), - rowHeaderViewport(), - label1("label1"), label2("label2"), label3("label3"), label4("label4"), - label5("label5"), label6("label6"), label7("label7"), label8("label8"), - label9("label1"), label10("label10"), label11("label11"), ruler("ruler") + ruler("ruler") { - rowHeaderBox.pack_start(label1); - rowHeaderBox.pack_start(label2); - rowHeaderBox.pack_start(label3); - rowHeaderBox.pack_start(label4); - rowHeaderBox.pack_start(label5); - rowHeaderBox.pack_start(label6); - rowHeaderBox.pack_start(label7); - rowHeaderBox.pack_start(label8); - rowHeaderBox.pack_start(label9); - rowHeaderBox.pack_start(label10); - rowHeaderBox.pack_start(label11); - rowHeaderViewport.add(rowHeaderBox); + rowHeaderLayout.set_size_request(100, 100); - rowHeaderViewport.set_hadjustment(horizontalAdjustment); - rowHeaderViewport.set_vadjustment(verticalAdjustment); + body = new TimelineBody(horizontalAdjustment, verticalAdjustment); + + verticalAdjustment.signal_value_changed().connect( + sigc::mem_fun(this, &TimelineWidget::on_scroll) ); + attach(*body, 1, 2, 1, 2, FILL|EXPAND, FILL|EXPAND); attach(ruler, 1, 2, 0, 1, FILL|EXPAND, SHRINK); - attach(rowHeaderViewport, 0, 1, 1, 2, SHRINK, FILL|EXPAND); + attach(rowHeaderLayout, 0, 1, 1, 2, SHRINK, FILL|EXPAND); attach(horizontalScroll, 1, 2, 2, 3, FILL|EXPAND, SHRINK); attach(verticalScroll, 2, 3, 1, 2, SHRINK, FILL|EXPAND); + + tracks.push_back(&video1); + tracks.push_back(&video2); + + layout_tracks(); } +TimelineWidget::~TimelineWidget() + { + delete body; + } +void +TimelineWidget::on_scroll() + { + move_headers(); + } + +void +TimelineWidget::layout_tracks() + { + vector::iterator i; + for(i = tracks.begin(); i != tracks.end(); i++) + { + timeline::Track *track = *i; + g_assert(track != NULL); + rowHeaderLayout.put(track->get_header_widget(), 0, 0); + } + + move_headers(); + } + +void +TimelineWidget::move_headers() + { + int offset = 0; + const int y_scroll_offset = (int)verticalAdjustment.get_value(); + + vector::iterator i; + for(i = tracks.begin(); i != tracks.end(); i++) + { + timeline::Track *track = *i; + g_assert(track != NULL); + + const int height = track->get_track_height(); + rowHeaderLayout.move(track->get_header_widget(), 0, offset - y_scroll_offset); + offset += height; + } + totalHeight = offset; + verticalAdjustment.set_upper(totalHeight); + } } // namespace widgets } // namespace gui diff --git a/src/gui/widgets/timeline-widget.hpp b/src/gui/widgets/timeline-widget.hpp index e89e684e0..7ceb3f125 100644 --- a/src/gui/widgets/timeline-widget.hpp +++ b/src/gui/widgets/timeline-widget.hpp @@ -1,5 +1,5 @@ /* - timeline.hpp - Declaration of the timeline widget + timeline-widget.hpp - Declaration of the timeline widget Copyright (C) Lumiera.org 2008, Joel Holdsworth @@ -19,40 +19,63 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/** @file timeline.hpp +/** @file timeline-widget.hpp ** This file contains the definition of timeline widget */ #ifndef TIMELINE_WIDGET_HPP #define TIMELINE_WIDGET_HPP +#include "timeline/timeline-body.hpp" +#include "timeline/track.hpp" +#include "timeline/video-track.hpp" + #include +#include namespace lumiera { namespace gui { namespace widgets { - class TimelineWidget : public Gtk::Table - { - public: - TimelineWidget(); +class TimelineWidget : public Gtk::Table + { + public: + TimelineWidget(); - /* ===== Overrides ===== */ - protected: - Gtk::Adjustment horizontalAdjustment, verticalAdjustment; - Gtk::HScrollbar horizontalScroll; - Gtk::VScrollbar verticalScroll; + ~TimelineWidget(); - Gtk::Viewport rowHeaderViewport; - Gtk::VBox rowHeaderBox; - Gtk::Label label1, label2, label3, label4; - Gtk::Label label5, label6, label7, label8; - Gtk::Label label9, label10, label11, label12; - Gtk::Label ruler; - }; + /* ===== Events ===== */ + protected: + void on_scroll(); + + /* ===== Internals ===== */ + protected: + void layout_tracks(); + + void move_headers(); + + protected: + int totalHeight; + + timeline::VideoTrack video1; + timeline::VideoTrack video2; + std::vector tracks; + + Gtk::Layout rowHeaderLayout; + Gtk::Label ruler; + + timeline::TimelineBody *body; + + Gtk::Adjustment horizontalAdjustment, verticalAdjustment; + Gtk::HScrollbar horizontalScroll; + Gtk::VScrollbar verticalScroll; + + friend class timeline::TimelineBody; + }; } // namespace widgets } // namespace gui } // namespace lumiera #endif // TIMELINE_WIDGET_HPP + diff --git a/src/gui/widgets/timeline/timeline-body.cpp b/src/gui/widgets/timeline/timeline-body.cpp new file mode 100644 index 000000000..f3e204cf9 --- /dev/null +++ b/src/gui/widgets/timeline/timeline-body.cpp @@ -0,0 +1,87 @@ +/* + timeline.cpp - Implementation of the timeline widget + + Copyright (C) Lumiera.org + 2008, Joel Holdsworth + + 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 + +#include "timeline-body.hpp" + +using namespace Gtk; +using namespace std; +using namespace lumiera::gui::widgets::timeline; + +namespace lumiera { +namespace gui { +namespace widgets { +namespace timeline { + +TimelineBody::TimelineBody(lumiera::gui::widgets::TimelineWidget &timeline_widget) : + timelineWidget(timeline_widget) + { + timelineWidget.horizontalAdjustment.signal_value_changed().connect( + sigc::mem_fun(this, &TimelineBody::on_scroll) ); + timelineWidget.verticalAdjustment.signal_value_changed().connect( + sigc::mem_fun(this, &TimelineBody::on_scroll) ); + } + +void +TimelineBody::on_scroll() + { + queue_draw(); + } + +bool +TimelineBody::on_expose_event(GdkEventExpose* event) + { + // This is where we draw on the window + Glib::RefPtr window = get_window(); + if(window) + { + Gtk::Allocation allocation = get_allocation(); + const int width = allocation.get_width(); + const int height = allocation.get_height(); + + Cairo::RefPtr cr = window->create_cairo_context(); + cr->set_line_width(10.0); + + cr->translate(-horizontalAdjustment.get_value(), -verticalAdjustment.get_value()); + cr->save(); + + vector::iterator i; + for(i = tracks.begin(); i != tracks.end(); i++) + { + timeline::Track *track = *i; + g_assert(track != NULL); + track->draw_track(); + } + + cr->restore(); + } + + return true; + + } + +} // namespace timeline +} // namespace widgets +} // namespace gui +} // namespace lumiera + diff --git a/src/gui/widgets/timeline/timeline-body.hpp b/src/gui/widgets/timeline/timeline-body.hpp new file mode 100644 index 000000000..39fd8773a --- /dev/null +++ b/src/gui/widgets/timeline/timeline-body.hpp @@ -0,0 +1,56 @@ +/* + timeline-body.hpp - Declaration of the timeline body widget + + Copyright (C) Lumiera.org + 2008, Joel Holdsworth + + 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. + +*/ +/** @file timeline-body.hpp + ** This file contains the definition of timeline body widget + */ + +#ifndef TIMELINE_BODY_HPP +#define TIMELINE_BODY_HPP + +#include + +namespace lumiera { +namespace gui { +namespace widgets { +namespace timeline { + +class TimelineBody : public Gtk::DrawingArea + { + public: + TimelineBody(lumiera::gui::widgets::TimelineWidget &timeline_widget); + + protected: + lumiera::gui::widgets::TimelineWidget &timelineWidget; + + /* ===== Events ===== */ + protected: + void on_scroll(); + + virtual bool on_expose_event(GdkEventExpose* event); + }; + +} // namespace timeline +} // namespace widgets +} // namespace gui +} // namespace lumiera + +#endif // TIMELINE_BODY_HPP diff --git a/src/gui/widgets/timeline/track.cpp b/src/gui/widgets/timeline/track.cpp new file mode 100644 index 000000000..c0564e37f --- /dev/null +++ b/src/gui/widgets/timeline/track.cpp @@ -0,0 +1,51 @@ +/* + track.cpp - Implementation of the timeline track object + + Copyright (C) Lumiera.org + 2008, Joel Holdsworth + + 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 "track.hpp" + +namespace lumiera { +namespace gui { +namespace widgets { +namespace timeline { + +Track::Track() + { + + } + +Glib::ustring +Track::get_title() + { + return "Hello"; + } + +void +Track::draw_track() + { + + } + +} // namespace timeline +} // namespace widgets +} // namespace gui +} // namespace lumiera + diff --git a/src/gui/widgets/timeline/track.hpp b/src/gui/widgets/timeline/track.hpp new file mode 100644 index 000000000..204b650a0 --- /dev/null +++ b/src/gui/widgets/timeline/track.hpp @@ -0,0 +1,59 @@ +/* + track.hpp - Declaration of the timeline track object + + Copyright (C) Lumiera.org + 2008, Joel Holdsworth + + 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. + +*/ +/** @file track.hpp + ** This file contains the definition of timeline track object + */ + +#ifndef TRACK_HPP +#define TRACK_HPP + +#include + +namespace lumiera { +namespace gui { +namespace widgets { +namespace timeline { + +class Track + { + public: + Track(); + + Glib::ustring get_title(); + + virtual Gtk::Widget& get_header_widget() = 0; + + virtual int get_track_height() = 0; + + virtual void draw_track(); + + protected: + + }; + + +} // namespace timeline +} // namespace widgets +} // namespace gui +} // namespace lumiera + +#endif // TRACK_HPP diff --git a/src/gui/widgets/timeline/video-track.cpp b/src/gui/widgets/timeline/video-track.cpp new file mode 100644 index 000000000..b3b45c543 --- /dev/null +++ b/src/gui/widgets/timeline/video-track.cpp @@ -0,0 +1,56 @@ +/* + video-track.cpp - Implementation of the timeline video track object + + Copyright (C) Lumiera.org + 2008, Joel Holdsworth + + 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 "video-track.hpp" + +using namespace Gtk; + +namespace lumiera { +namespace gui { +namespace widgets { +namespace timeline { + +VideoTrack::VideoTrack() : + headerWidget("HeaderTest") + { + + } + +Gtk::Widget& VideoTrack::get_header_widget() + { + return headerWidget; + } + +int VideoTrack::get_track_height() + { + return 100; + } + +void VideoTrack::draw_track() + { + + } + +} // namespace timeline +} // namespace widgets +} // namespace gui +} // namespace lumiera diff --git a/src/gui/widgets/timeline/video-track.hpp b/src/gui/widgets/timeline/video-track.hpp new file mode 100644 index 000000000..e82a178bd --- /dev/null +++ b/src/gui/widgets/timeline/video-track.hpp @@ -0,0 +1,57 @@ +/* + video-track.hpp - Declaration of the timeline video track object + + Copyright (C) Lumiera.org + 2008, Joel Holdsworth + + 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. + +*/ +/** @file video-track.hpp + ** This file contains the definition of video track object + */ + +#ifndef VIDEO_TRACK_HPP +#define VIDEO_TRACK_HPP + +#include "track.hpp" + +namespace lumiera { +namespace gui { +namespace widgets { +namespace timeline { + +class VideoTrack : public Track + { + public: + VideoTrack(); + + virtual Gtk::Widget& get_header_widget(); + + virtual int get_track_height(); + + virtual void draw_track(); + + protected: + Gtk::Label headerWidget; + }; + +} // namespace timeline +} // namespace widgets +} // namespace gui +} // namespace lumiera + +#endif // VIDEO_TRACK_HPP + diff --git a/src/gui/widgets/video-display-widget.hpp b/src/gui/widgets/video-display-widget.hpp index 7a80a4b04..66e224c18 100644 --- a/src/gui/widgets/video-display-widget.hpp +++ b/src/gui/widgets/video-display-widget.hpp @@ -51,6 +51,7 @@ namespace widgets { virtual bool on_expose_event(GdkEventExpose* event); + // TEST CODE!!!! virtual bool on_button_press_event (GdkEventButton* event); /* ===== Internals ===== */ From 71b45acf54b7e970957ef2089e1284fa5ff3e12b Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Sat, 31 May 2008 17:44:44 +0100 Subject: [PATCH 049/110] Styles for custom widgets now load --- src/gui/lumiera_ui.rc | 1443 +------------------- src/gui/widgets/timeline-widget.cpp | 2 +- src/gui/widgets/timeline/timeline-body.cpp | 92 +- src/gui/widgets/timeline/timeline-body.hpp | 14 +- src/gui/widgets/timeline/track.cpp | 2 +- src/gui/widgets/timeline/track.hpp | 2 +- src/gui/widgets/timeline/video-track.cpp | 2 +- src/gui/widgets/timeline/video-track.hpp | 2 +- 8 files changed, 119 insertions(+), 1440 deletions(-) diff --git a/src/gui/lumiera_ui.rc b/src/gui/lumiera_ui.rc index d87322014..f0c1163e5 100644 --- a/src/gui/lumiera_ui.rc +++ b/src/gui/lumiera_ui.rc @@ -1,86 +1,22 @@ # -# This is the GTK style file for Ardour +# This is the GTK style file for Lumiera # # -style "very_small_text" +#---------- Styles for Standard Widgets ----------# + +style "medium_bold_entry" { - font_name = "sans 7" -} + font_name = "sans bold 10" -style "small_text" -{ - font_name = "sans 8" -} - -style "small_bold_text" -{ - font_name = "sans bold 8" -} - -style "medium_bold_text" -{ - font_name = "sans bold 8" -} - -style "medium_text" -{ - font_name = "sans 8" -} - -style "red_medium_text" = "medium_text" -{ - fg[NORMAL] = { 1.0, 0, 0 } - fg[ACTIVE] = { 1.0, 0, 0 } - fg[SELECTED] = { 1.0, 0, 0 } -} - - -style "large_text" -{ - font_name = "sans 18" -} - -style "larger_bold_text" -{ - font_name = "sans bold 14" -} - -style "plugin_name_text" -{ - font_name = "sans bold 25" - fg[NORMAL] = { 0.80, 0.80, 0.80 } -} - -style "plugin_maker_text" -{ - font_name = "sans bold 14" - fg[NORMAL] = { 0.80, 0.80, 0.80 } -} - -style "automation_track_name" -{ - font_name = "sans italic 8" -} - -style "first_action_message" -{ - font_name = "sans medium 34" -} - -style "verbose_canvas_cursor" -{ - font_name = "sans bold 24" -} - -style "marker_text" -{ - font_name = "sans 8" -} - -style "time_axis_view_item_name" -{ - font_name = "sans 9" + fg[NORMAL] = { 0.70, 0.70, 0.70 } + fg[ACTIVE] = { 0.70, 0.70, 0.70 } + + bg[NORMAL] = { 0.35, 0.35, 0.40 } + + base[NORMAL] = { 0, 0, 0 } + base[ACTIVE] = { 0, 0, 0 } + base[SELECTED] = { 0, 0, 0 } } style "default_base" = "medium_text" @@ -120,37 +56,15 @@ style "default_base" = "medium_text" engine "clearlooks" { menubarstyle = 2 # 0 = flat, 1 = sunken, 2 = flat gradient - menuitemstyle = 1 # 0 = flat, 1 = 3d-ish (gradient), 2 = 3d-ish (button) - listviewitemstyle = 1 # 0 = flat, 1 = 3d-ish (gradient) - progressbarstyle = 1 # 0 = candy bar, 1 = fancy candy bar, 2 = flat +# menuitemstyle = 1 # 0 = flat, 1 = 3d-ish (gradient), 2 = 3d-ish (button) +# listviewitemstyle = 1 # 0 = flat, 1 = 3d-ish (gradient) +# progressbarstyle = 1 # 0 = candy bar, 1 = fancy candy bar, 2 = flat } } -style "base_frame" -{ - fg[NORMAL] = { 0.80, 0.80, 0.80 } - bg[NORMAL] = { 0.35, 0.35, 0.40 } -} - -style "transport_base" = "medium_bold_text" -{ - bg[NORMAL] = { 0.10, 0.10, 0.10 } - bg[ACTIVE] = { 0, 0, 0 } - bg[PRELIGHT] = { 0, 0, 0 } - bg[INSENSITIVE] = { 0, 0, 0 } - bg[SELECTED] = { 0, 0, 0 } -} - -style "black_mackie_menu_bar" -{ - font_name = "sans bold 9" - fg[NORMAL] = { 1.0, 1.0, 1.0 } - bg[NORMAL] = { 0, 0, 0 } -} - style "default_buttons_menus" { - font_name = "sans 8" + font_name = "sans 10" fg[ACTIVE] = { 1.0, 1.0, 1.0 } bg[NORMAL] = { 0.30, 0.30, 0.35 } @@ -160,913 +74,23 @@ style "default_buttons_menus" bg[SELECTED] = { 0.15, 0.15, 0.20 } } -style "very_small_button" = "default_buttons_menus" -{ - font_name = "sans 7" - ythickness = 0 - xthickness = 0 -} - -style "small_button" = "default_buttons_menus" -{ -} - -style "very_small_red_active_and_selected_button" = "very_small_button" -{ - bg[ACTIVE] = { 1.0, 0, 0} - bg[SELECTED] = { 1.0, 0, 0} -} - -style "small_red_active_and_selected_button" = "small_button" -{ - fg[ACTIVE] = { 0, 0, 0 } - bg[ACTIVE] = { 1.0, 0, 0} - bg[SELECTED] = { 1.0, 0, 0} -} - -style "gain_fader" -{ - bg[NORMAL] = { 0.269, 0.269, 0.300} - bg[ACTIVE] = { 0.152, 0.152, 0.168 } -} - - -style "track_rec_enable_button" = "small_button" -{ -} - -style "track_rec_enable_button_active" = "small_button" -{ - fg[SELECTED] = { 0.0, 0.0, 0.0 } - fg[ACTIVE] = { 0.0, 0.0, 0.0 } - fg[PRELIGHT] = { 0.0, 0.0, 0.0 } - fg[NORMAL] = { 0.0, 0.0, 0.0 } - - bg[NORMAL] = { 1.0, 0.0, 0.0 } - bg[ACTIVE] = { 1.0, 0.0, 0.0 } - bg[SELECTED] = { 1.0, 0.0, 0.0 } - bg[PRELIGHT] = { 1.0, 0.0, 0.0 } -} - -style "track_rec_enable_button_alternate" = "small_button" -{ - fg[SELECTED] = { 0.0, 0.0, 0.0 } - fg[ACTIVE] = { 0.0, 0.0, 0.0 } - fg[PRELIGHT] = { 0.0, 0.0, 0.0 } - fg[NORMAL] = { 0.0, 0.0, 0.0 } - - bg[NORMAL] = { 0.91, 0.68, 0.68} - bg[ACTIVE] = { 0.91, 0.68, 0.68} - bg[SELECTED] = { 0.91, 0.68, 0.68} - bg[PRELIGHT] = { 0.91, 0.68, 0.68} -} - -style "mixer_track_rec_enable_button" = "track_rec_enable_button" -{ - font_name = "sans 7" - xthickness = 0 - ythickness = 0 -} - -style "mixer_track_rec_enable_button_alternate" = "track_rec_enable_button_alternate" -{ - font_name = "sans 7" - xthickness = 0 - ythickness = 0 -} - -style "mixer_track_rec_enable_button_active" = "track_rec_enable_button_active" -{ - font_name = "sans 7" - xthickness = 0 - ythickness = 0 -} - -style "solo_button" = "small_button" -{ -} - -style "solo_button_alternate" = "small_button" -{ - bg[NORMAL] = { 0.19, 0.97, 0.69 } # solo-safe - bg[ACTIVE] = { 0.19, 0.97, 0.69 } # solo-safe - bg[SELECTED] = { 0.19, 0.97, 0.69 } # solo-safe - bg[PRELIGHT] = { 0.19, 0.97, 0.69 } # solo-safe - - fg[ACTIVE] = { 0, 0, 0 } - fg[SELECTED] = { 0, 0, 0 } - fg[NORMAL] = { 0, 0, 0 } - fg[PRELIGHT] = { 0, 0, 0 } -} - - -style "solo_button_active" = "small_button" -{ - bg[NORMAL] = { 0.66, 0.97, 0.19 } # solo - bg[ACTIVE] = { 0.66, 0.97, 0.19 } # solo - bg[SELECTED] = { 0.66, 0.97, 0.19 } # solo - bg[PRELIGHT] = { 0.66, 0.97, 0.19 } # solo - - fg[ACTIVE] = { 0, 0, 0 } - fg[SELECTED] = { 0, 0, 0 } - fg[NORMAL] = { 0, 0, 0 } - fg[PRELIGHT] = { 0, 0, 0 } -} - -style "mixer_solo_button" = "solo_button" -{ - font_name = "sans 7" - xthickness = 0 - ythickness = 0 -} - -style "mixer_solo_button_alternate" = "solo_button_alternate" -{ - font_name = "sans 7" - xthickness = 0 - ythickness = 0 -} -style "mixer_solo_button_active" = "solo_button_active" -{ - font_name = "sans 7" - xthickness = 0 - ythickness = 0 -} - - -style "mute_button" = "small_button" -{ -} - -style "mute_button_alternate" = "small_button" -{ - bg[ACTIVE] = { 1.0, 0.98, 0.53 } - bg[NORMAL] = { 1.0, 0.98, 0.53 } - bg[SELECTED] = { 1.0, 0.98, 0.53 } - bg[PRELIGHT] = { 1.0, 0.98, 0.53 } - - fg[SELECTED] = { 0, 0, 0 } - fg[ACTIVE] = { 0, 0, 0 } - fg[NORMAL] = { 0, 0, 0 } - fg[PRELIGHT] = { 0, 0, 0 } -} - -style "mute_button_active" = "small_button" -{ - bg[NORMAL] = { 0.90, 0.89, 0.73 } - bg[ACTIVE] = { 0.90, 0.89, 0.73 } - bg[PRELIGHT] = { 0.90, 0.89, 0.73 } - bg[SELECTED] = { 0.90, 0.89, 0.73 } - - fg[SELECTED] = { 0, 0, 0 } - fg[ACTIVE] = { 0, 0, 0 } - fg[NORMAL] = { 0, 0, 0 } - fg[PRELIGHT] = { 0, 0, 0 } -} - -style "mixer_mute_button" = "mute_button" -{ - font_name = "sans 7" - xthickness = 0 - ythickness = 0 -} - -style "mixer_mute_button_alternate" = "mute_button_alternate" -{ - font_name = "sans 7" - xthickness = 0 - ythickness = 0 -} - -style "mixer_mute_button_active" = "mute_button_active" -{ - font_name = "sans 7" - xthickness = 0 - ythickness = 0 -} - -style "multiline_combo" = "small_button" -{ - font_name = "sans 8" - xthickness = 0 - ythickness = 0 -} - -style "mixer_mute_button" = "mute_button" -{ - font_name = "sans 7" - xthickness = 0 - ythickness = 0 -} - -style "track_loop_button" = "small_button" -{ - bg[ACTIVE] = { 1.0, 0.98, 0.53 } - bg[PRELIGHT] = { 1.0, 0.98, 0.53 } - -} - -style "mixer_red_active_button" = "very_small_button" -{ - fg[ACTIVE] = { 0, 1.0, 1.0 } - bg[ACTIVE] = { 0.7, 0, 0 } - - base[INSENSITIVE] = { 0.16, 0.16, 0.21 } - bg[INSENSITIVE] = { 0.16, 0.16, 0.21 } -} - -style "time_button" = "default_buttons_menus" -{ - font_name = "sans 8" -} - -style "transport_button" -{ -} - -style "transport_button_active" -{ - bg[NORMAL] = { 0.50, 1.0, 0.50 } - bg[ACTIVE] = { 0.50, 1.0, 0.50 } - bg[SELECTED] = { 0.50, 1.0, 0.50 } - bg[PRELIGHT] = { 0.50, 1.0, 0.50 } - - fg[NORMAL] = { 0, 0, 0 } - fg[PRELIGHT] = { 0, 0, 0 } - fg[SELECTED] = { 0, 0, 0 } - fg[ACTIVE] = { 0, 0, 0 } -} - -style "transport_rec_button" -{ -} - -style "transport_rec_button_active" -{ - bg[ACTIVE] = { 1.0, 0, 0 } - bg[NORMAL] = { 1.0, 0, 0 } - bg[SELECTED] = { 1.0, 0, 0 } - bg[PRELIGHT] = { 1.0, 0, 0 } -} - -style "transport_rec_button_alternate" -{ - bg[PRELIGHT] = { 0.91, 0.68, 0.68 } - bg[NORMAL] = { 0.91, 0.68, 0.68 } - bg[SELECTED] = { 0.91, 0.68, 0.68 } - bg[ACTIVE] = { 0.91, 0.68, 0.68 } -} - -style "shuttle_control" = "very_small_text" -{ - fg[NORMAL] = { 0.85, 0.92, 0.98 } - fg[ACTIVE] = { 0.85, 0.92, 0.98 } - fg[PRELIGHT] = { 0.85, 0.92, 0.98 } - fg[SELECTED] = { 0.85, 0.92, 0.98 } - fg[INSENSITIVE] = { 0.85, 0.92, 0.98 } - - bg[NORMAL] = { 0.26, 0.26, 0.31 } - bg[PRELIGHT] = { 0.26, 0.26, 0.31 } - bg[INSENSITIVE] = { 0.26, 0.26, 0.31 } - bg[ACTIVE] = { 0.70, 0.70, 0.70 } - bg[SELECTED] = { 1.0, 0.04, 0.04 } -} - -style "ardour_adjusters" = "default_buttons_menus" +style "lumiera_adjusters" = "default_buttons_menus" { bg[NORMAL] = { 0.60, 0.60, 0.60 } bg[PRELIGHT] = { 0.80, 0.80, 0.80 } bg[ACTIVE] = { 0.06, 0.06, 0.06 } } -style "editor_hscrollbar" = "ardour_adjusters" -{ - # - # special case: we want this scrollbar to be as tall as the - # zoom focus selector combobox. scrollbars don't expand to - # fill the space available to them, so we have to explicitly - # make it bigger. - # - GtkRange::slider_width = 27 - GtkScrollbar::slider_width = 27 -} - -style "ardour_progressbars" = "default_buttons_menus" +style "lumiera_progressbars" = "default_buttons_menus" { bg[NORMAL] = { 0, 0, 0 } bg[PRELIGHT] = { 0.00, 0.36, 0.40 } } -style "options_window" = "default_base" +style "lumiera_button" = "default_buttons_menus" { - font_name = "sans 8" - fg[PRELIGHT] = { 0.80, 0.80, 0.80 } -} - -style "option_entry" = "default_base" -{ - fg[NORMAL] = { 1.0, 1.0, 1.0 } - fg[ACTIVE] = { 1.0, 1.0, 1.0 } - fg[INSENSITIVE] = { 0.80, 0.80, 0.80 } - - base[INSENSITIVE] = { 0.07, 0.07, 0.12 } - - bg[NORMAL] = { 0.35, 0.35, 0.40 } - bg[ACTIVE] = { 0.35, 0.35, 0.40 } -} - -style "red_when_active" = "medium_text" -{ - fg[NORMAL] = { 0.80, 0.80, 0.80 } - bg[NORMAL] = { 0.26, 0.26, 0.31 } - - fg[ACTIVE] = { 0.80, 0.80, 0.80 } - bg[ACTIVE] = { 1.0, 0, 0} -} - -style "xrun_warn" -{ - font_name = "sans bold 18" - - fg[NORMAL] = { 1.0, 1.0, 1.0 } - fg[ACTIVE] = { 1.0, 1.0, 1.0 } - text[NORMAL] = { 1.0, 1.0, 1.0 } - text[ACTIVE] = { 1.0, 1.0, 1.0 } - base[NORMAL] = { 0.09, 0.48, 0.46 } - base[ACTIVE] = { 0.09, 0.48, 0.46 } - bg[NORMAL] = { 1.0, 0.48, 0.46 } - bg[ACTIVE] = { 0.09, 1.0, 0.46 } -} - -style "menu_bar_base" = "default_base" -{ - bg[NORMAL] = { 0.2, 0.2, 0.3 } - bg[ACTIVE] = { 0, 0, 0 } - bg[PRELIGHT] = { 0, 0, 0 } - bg[INSENSITIVE] = { 0, 0, 0 } - bg[SELECTED] = { 0, 0, 0 } -} - -style "fatal_message" = "medium_text" -{ - fg[ACTIVE] = { 1.0, 0, 1.0 } - fg[NORMAL] = { 0.80, 0.80, 0.80 } - bg[ACTIVE] = { 0,0,0 } - bg[NORMAL] = { 0,0,0 } - base[ACTIVE] = { 0,0,0 } - base[NORMAL] = { 0,0,0 } -} - -style "error_message" = "medium_text" -{ - fg[ACTIVE] = { 1.0, 0, 0 } - fg[NORMAL] = { 0.80, 0.80, 0.80 } - bg[ACTIVE] = { 0,0,0 } - bg[NORMAL] = { 0,0,0 } - base[ACTIVE] = { 0,0,0 } - base[NORMAL] = { 0,0,0 } -} - -style "info_message" = "medium_text" -{ - fg[ACTIVE] = { 1.0, 0, 0 } - fg[NORMAL] = { 0.80, 0.80, 0.80 } - bg[ACTIVE] = { 0,0,0 } - bg[NORMAL] = { 0,0,0 } - base[ACTIVE] = { 0,0,0 } - base[NORMAL] = { 0,0,0 } -} - -style "warning_message" = "medium_text" -{ - fg[ACTIVE] = { 0.30,0.30, 1.0 } - fg[NORMAL] = { 0.80, 0.80, 0.80 } - bg[ACTIVE] = { 0, 0, 0 } - bg[NORMAL] = { 0, 0, 0 } - base[ACTIVE] = { 0, 0, 0 } - base[NORMAL] = { 0, 0, 0 } -} - -style "medium_entry" = "medium_text" -{ - fg[NORMAL] = { 0.70, 0.70, 0.70 } - fg[ACTIVE] = { 0.70, 0.70, 0.70 } - fg[SELECTED] = { 1.0, 1.0, 1.0 } - - bg[NORMAL] = { 0.35, 0.35, 0.40 } - - base[NORMAL] = { 0, 0, 0 } - base[ACTIVE] = { 0, 0, 0 } - base[SELECTED] = { 0.70, 0.70, 0.70 } -} - -style "medium_entry_noselection_fg" = "medium_entry" -{ - fg[SELECTED] = { 0.50, 1.0, 0.50 } -} - -style "medium_entry_noselection_bg" = "medium_entry" -{ - bg[SELECTED] = { 1.0, 1.0, 1.0 } -} - -style "medium_bold_entry" = "medium_bold_text" -{ - fg[NORMAL] = { 0.70, 0.70, 0.70 } - fg[ACTIVE] = { 0.70, 0.70, 0.70 } - - bg[NORMAL] = { 0.35, 0.35, 0.40 } - - base[NORMAL] = { 0, 0, 0 } - base[ACTIVE] = { 0, 0, 0 } - base[SELECTED] = { 0, 0, 0 } -} - -style "small_entry" = "small_text" -{ - fg[NORMAL] = { 0.70, 0.70, 0.70 } - fg[ACTIVE] = { 0, 1.0, 0 } - fg[SELECTED] = { 0, 1.0, 0 } - text[NORMAL] = { 0.70, 0.70, 0.70 } - text[ACTIVE] = { 0, 1.0, 0 } - text[SELECTED] = { 0, 1.0, 0 } - bg[NORMAL] = { 0.0, 0.0, 0.0 } - bg[SELECTED] = { 0.0, 0.0, 0.0 } - bg[SELECTED] = { 0.0, 0.0, 0.0 } - base[NORMAL] = { 0, 0, 0 } - base[ACTIVE] = { 0, 0, 0 } - base[SELECTED] = { 0, 0, 0 } -} - -style "red_active_small_entry" = "small_entry" -{ - fg[ACTIVE] = { 1.0, 0.0, 0.0 } - fg[SELECTED] = { 1.0, 0, 0 } -} - -style "small_bold_entry" = "small_bold_text" -{ - fg[NORMAL] = { 0.70, 0.70, 0.70 } - fg[ACTIVE] = { 0.70, 0.70, 0.70 } - - bg[NORMAL] = { 0.35, 0.35, 0.40 } - - base[NORMAL] = { 0, 0, 0 } - base[ACTIVE] = { 0, 0, 0 } - base[SELECTED] = { 0, 0, 0 } -} - -style "small_red_on_black_entry" = "small_bold_text" -{ - fg[NORMAL] = { 1.0, 0, 0 } - fg[ACTIVE] = { 1.0, 0, 0 } - base[NORMAL] = { 0.0, 0.0, 0.0 } - base[ACTIVE] = { 0.0, 0.0, 0.0 } - bg[NORMAL] = { 0.0, 0.0, 0.0 } - bg[ACTIVE] = { 0.0, 0.0, 0.0 } -} - -style "non_recording_big_clock_display" = "medium_entry" -{ - font_name = "sans 60" - - fg[NORMAL] = { 0.50, 1.0, 0.50 } - fg[ACTIVE] = { 1.0, 0, 0.0 } - fg[SELECTED] = { 1.0, 0, 0 } - fg[PRELIGHT] = { 1.0, 0, 0.0 } - fg[INSENSITIVE] = { 1.0, 0, 0.0 } - - base[NORMAL] = { 0.0, 0.0, 0.0 } - base[ACTIVE] = { 0.0, 0.0, 0.0 } - bg[NORMAL] = { 0.0, 0.0, 0.0 } - bg[ACTIVE] = { 0.7, 0.0, 0.0 } -} - -style "recording_big_clock_display" = "non_recording_big_clock_display" -{ - fg[NORMAL] = { 1.0, 0, 0 } -} - -style "transport_clock_display" -{ - font_name = "sans bold 14" - - fg[NORMAL] = { 0.50, 1.0, 0.50 } - fg[ACTIVE] = { 1.0, 0, 0.0 } - fg[SELECTED] = { 1.0, 0, 0 } - fg[PRELIGHT] = { 1.0, 0, 0.0 } - fg[INSENSITIVE] = { 1.0, 0, 0.0 } - - base[NORMAL] = { 0.0, 0.0, 0.0 } - base[ACTIVE] = { 0.0, 0.0, 0.0 } - bg[NORMAL] = { 0.0, 0.0, 0.0 } - bg[ACTIVE] = { 0.0, 0.0, 0.0 } -} - -style "tempo_meter_clock_display" -{ - font_name = "sans 7" - fg[NORMAL] = { 1.0, 1.0, 1.0 } - fg[ACTIVE] = { 1.0, 1.0, 0.0 } - fg[SELECTED] = { 1.0, 0, 0 } - base[NORMAL] = { 0.0, 0.48, 1.0 } - base[ACTIVE] = { 0.09, 0.98, 0.46 } - bg[NORMAL] = { 0.0, 0.48, 1.0 } - bg[ACTIVE] = { 0.09, 0.98, 0.46 } -} - -style "default_clock_display" = "medium text" -{ - fg[NORMAL] = { 0.50, 1.0, 0.50 } - fg[ACTIVE] = { 1.0, 0.0, 0.0 } - fg[SELECTED] = { 1.0, 0, 0 } - base[NORMAL] = { 0, 0, 0 } - base[ACTIVE] = { 0, 0, 0 } - bg[NORMAL] = { 0, 0, 0 } - bg[ACTIVE] = { 0, 0, 0 } -} - -style "editor_time_ruler" = "small_text" -{ - fg[NORMAL] = { 0.80, 0.80, 0.80 } - bg[NORMAL] = { 0.09, 0.09, 0.09 } -} - -style "audio_track_base" = "default_base" -{ - font_name = "sans 6" - fg[NORMAL] = { 0.77, 0.77, 0.72 } - bg[NORMAL] = { 0.18, 0.19, 0.22 } - bg[ACTIVE] = { 0.20, 0.20, 0.20 } - bg[PRELIGHT] = { 0.20, 0.20, 0.20 } - bg[INSENSITIVE] = { 0.20, 0.20, 0.20 } - bg[SELECTED] = { 0.20, 0.20, 0.20 } -} - -style "audio_bus_base" -{ - font_name = "sans 6" - fg[NORMAL] = { 0.77, 0.77, 0.72 } - fg[NORMAL] = { 0.7, 0.8, 0.2 } - #bg[NORMAL] = {0, 0.36, 0.40 } - bg[NORMAL] = "#444466" -} - -style "track_name_display" -{ - font_name = "sans medium 8" - fg[NORMAL] = { 0.80, 0.80, 0.80 } - fg[ACTIVE] = { 0.80, 0.80, 0.80 } - - base[NORMAL] = { 0.06, 0.06, 0.06 } - base[ACTIVE] = { 0.26, 0.26, 0.26 } - bg[NORMAL] = { 0.26, 0.26, 0.26 } - bg[ACTIVE] = { 0.26, 0.26, 0.26 } -} - -style "active_track_name_display" -{ - font_name = "sans medium 8" - text[NORMAL] = { 0.26, 0.26, 0.26 } - base[NORMAL] = { 0.89, 0.89, 0.89 } -} - -style "track_separator" -{ - bg[NORMAL] = { 0.35, 0.35, 0.40 } -} - -# -# Track edit groups. These styles define -# the colors that the "edit" button will -# use as a track is moved from -# track edit group to track edit group. -# There are 8 edit groups. Edit group 0 -# is used for tracks that are not editable, -# so we leave its style to the default. -# - -style "edit_group_0" - -{ - bg[ACTIVE] = { 1.0, 0.65, 0.13 } - bg[NORMAL] = { 0.31, 0.31, 0.31 } - fg[NORMAL] = { 0.82, 0.91, 0.99 } - fg[ACTIVE] = { 0, 0, 0 } -} - -style "edit_group_1" -{ - fg[NORMAL] = { 0, 0, 0 } - fg[PRELIGHT] = { 0, 0, 0 } - fg[SELECTED] = { 0, 0, 0 } - bg[NORMAL] = { 0.93, 0.34, 0.08 } - bg[PRELIGHT] = { 0.93, 0.34, 0.08 } - bg[SELECTED] = { 0.93, 0.34, 0.08 } -} - -style "edit_group_2" -{ - fg[NORMAL] = { 0, 0, 0 } - fg[PRELIGHT] = { 0, 0, 0 } - fg[SELECTED] = { 0, 0, 0 } - bg[NORMAL] = { 0.93, 0.34, 0.08 } - bg[PRELIGHT] = { 0.93, 0.34, 0.08 } - bg[SELECTED] = { 0.93, 0.34, 0.08 } -} - -style "edit_group_3" -{ - fg[NORMAL] = { 0, 0, 0 } - fg[PRELIGHT] = { 0, 0, 0 } - fg[SELECTED] = { 0, 0, 0 } - bg[NORMAL] = { 0.93, 0.34, 0.08 } - bg[PRELIGHT] = { 0.93, 0.34, 0.08 } - bg[SELECTED] = { 0.93, 0.34, 0.08 } -} - -style "treeview_parent_node" -{ - # specifies *just* the color used for whole file rows when not selected - fg[NORMAL] = { 0.0, 0.6, 0.85 } -} - -style "treeview_display" = "small_bold_text" -{ - # expander arrow border and DnD "icon" text - fg[NORMAL] = { 0.8, 0.8, 0.8 } - - # background with no rows or no selection, plus - # expander arrow core and DnD "icon" background - base[NORMAL] = { 0.20, 0.20, 0.25 } - - # selected row bg when window does not have focus (including during DnD) - base[ACTIVE] = { 0.0, 0.60, 0.60 } - - # selected row bg when window has focus - base[SELECTED] = { 0, 0.75, 0.75 } - - # row text when in normal state and not a parent - text[NORMAL] = { 0.80, 0.80, 0.80 } - - # selected row text with window focus - text[SELECTED] = { 0, 1.0, 1.0 } - - # selected row text without window focus (including during DnD) - text[ACTIVE] = { 0, 1.0, 1.0 } -} - -style "main_canvas_area" -{ - bg[NORMAL] = { 0.30, 0.30, 0.34 } - bg[ACTIVE] = { 0.30, 0.30, 0.34 } - bg[INSENSITIVE] = { 0.30, 0.30, 0.34 } - bg[SELECTED] = { 0.30, 0.30, 0.34 } - bg[PRELIGHT] = { 0.30, 0.30, 0.34 } -} - -style "track_controls_inactive" -{ - bg[NORMAL] = { 0.60, 0.60, 0.66 } - bg[ACTIVE] = { 0.60, 0.60, 0.66 } - bg[INSENSITIVE] = { 0.60, 0.60, 0.66 } - bg[SELECTED] = { 0.60, 0.60, 0.66 } - bg[PRELIGHT] = { 0.60, 0.60, 0.66 } - - font_name = "sans medium 10" - fg[NORMAL] = { 0.7, 0.8, 0.2 } -} - -style "edit_controls_base_selected" -{ - bg[NORMAL] = { 0.60, 0.54, 0.60 } - bg[ACTIVE] = { 0.60, 0.54, 0.60 } - bg[INSENSITIVE] = { 0.60, 0.54, 0.60 } - bg[SELECTED] = { 0.60, 0.54, 0.60 } - bg[PRELIGHT] = { 0.60, 0.54, 0.60 } -} - -style "automation_track_controls_base" -{ - bg[NORMAL] = { 0.22, 0.22, 0.29 } - bg[ACTIVE] = { 0.22, 0.22, 0.29 } - bg[INSENSITIVE] = { 0.22, 0.22, 0.29 } - bg[SELECTED] = { 0.22, 0.22, 0.29 } - bg[PRELIGHT] = { 0.22, 0.22, 0.29 } -} - -# Plugin Editors -style "plugin_slider" -{ - font_name ="sans bold 10" - - # the slider itself. the inactive part is INSENSITIVE, - # the active part is something else. - - fg[NORMAL] = { 0.37, 0.43, 0.52 } - fg[ACTIVE] = { 0.37, 0.43, 0.52 } - fg[INSENSITIVE] = {0.35, 0.35, 0.40 } # matches default_base - fg[SELECTED] = { 0.37, 0.43, 0.52 } - fg[PRELIGHT] = { 0.37, 0.43, 0.52 } - - # draws the outer rectangle around the slider - - bg[NORMAL] = { 0.80, 0.80, 0.80 } - bg[ACTIVE] = { 0.80, 0.80, 0.80 } - bg[INSENSITIVE] = {0.80, 0.80, 0.80 } - bg[SELECTED] = { 0.80, 0.80, 0.80 } - bg[PRELIGHT] = { 0.80, 0.80, 0.80 } - - # the numeric display - - text[NORMAL] = { 0.80, 0.80, 0.80 } - text[ACTIVE] = { 0.80, 0.80, 0.80 } - text[INSENSITIVE] = { 0.80, 0.80, 0.80 } - text[SELECTED] = { 0.80, 0.80, 0.80 } - text[PRELIGHT] = { 0.80, 0.80, 0.80 } -} - -style "track_list_display" = "small_bold_text" -{ - text[NORMAL] = { 0.80, 0.80, 0.80 } - text[ACTIVE] = { 0.3, 0.3, 0.3 } - text[INSENSITIVE] = { 0, 0, 0 } - text[SELECTED] = { 0.8, 0.8, 0.8 } - - base[NORMAL] = { 0, 0, 0 } - base[ACTIVE] = { 0, 0, 0 } - base[INSENSITIVE] = { 0, 0, 0 } - base[SELECTED] = { 0, 0, 0 } -} - -style "inspector_track_list_display" = "track_list_display" -{ - text[ACTIVE] = { 0.8, 0.8, 0.8 } - - base[NORMAL] = { 0, 0, 0 } - base[ACTIVE] = { 0.2, 0.2, 0.2 } - base[INSENSITIVE] = { 0, 0, 0 } - base[SELECTED] = { 0.3, 0.3, 0.4 } -} - -style "redirect_list_display" -{ - GtkTreeView::horizontal-separator = 0 - GtkTreeView::vertical-separator = 0 - - font_name = "sans 7" - text[NORMAL] = { 0.80, 0.80, 0.80 } - text[ACTIVE] = { 0.70, 0.70, 0.70 } - text[INSENSITIVE] = { 0, 0, 0 } - text[SELECTED] = { 0.9, 0.3, 0.3 } - - base[NORMAL] = { 0, 0, 0 } - base[ACTIVE] = { 0, 0, 0 } - base[INSENSITIVE] = { 0, 0, 0 } - base[SELECTED] = { 0, 0, 0 } - - # these two are explicitly used by the cell renderer for the - # text - - fg[NORMAL] = { 0.5, 0.5, 0.5 } # used for inactive - fg[ACTIVE] = { 1.0, 1.0, 1.0 } # used for active -} - -style "inspector_redirect_list_display" = "redirect_list_display" -{ - base[SELECTED] = { 0.3, 0.3, 0.3 } -} - -# MixerPanZone: -# -# the NORMAL fg color is used for the pan puck -# the ACTIVE fg color is used for the speaker boxes - -style "pan_zone" = "default_base" -{ - fg[NORMAL] = { 0.34, 0.95, 0.92 } - fg[ACTIVE] = { 0.95, 0.48, 0.11 } -} - -style "paler_red_when_active" = "medium_text" -{ - fg[NORMAL] = { 0.80, 0.80, 0.80 } - fg[PRELIGHT] = { 0.80, 0.80, 0.80 } - bg[NORMAL] = { 0.31, 0.31, 0.31 } - bg[PRELIGHT] = { 0.31, 0.31, 0.31 } - - fg[ACTIVE] = { 0.36, 0.46, 0.28 } - bg[ACTIVE] = { 1.00, 0.59, 0.59} -} - -style "peak_display_peaked_entry" = "small_text" -{ - fg[NORMAL] = { 1.0, 1.0, 1.0 } - fg[ACTIVE] = { 1.0, 1.0, 1.0 } - fg[SELECTED] = { 1.0, 1.0, 1.0 } - - bg[NORMAL] = {0.9, 0.0, 0.0 } - bg[ACTIVE] = { 0.9, 0.0, 0.0 } - bg[PRELIGHT] = { 0.9, 0.0, 0.0 } - bg[INSENSITIVE] = { 0.9, 0.0, 0.0 } - bg[SELECTED] = { 0.9, 0.0, 0.0 } - base[NORMAL] = { 0.9, 0.0, 0.0 } - base[ACTIVE] = { 0.9, 0.0, 0.0 } - base[PRELIGHT] = { 0.9, 0.0, 0.0 } - base[INSENSITIVE] = { 0.9, 0.0, 0.0 } - base[SELECTED] = { 0.9, 0.0, 0.0 } -} - -style "selected_strip_frame" -{ - fg[NORMAL] = { 0.74, 0.42, 0.47 } - bg[NORMAL] = { 0.79, 0.28, 0.18 } -} - -style "flashing_alert" = "very_small_text" -{ - fg[NORMAL] = { 0.80, 0.80, 0.80 } - bg[NORMAL] = { 0.26, 0.26, 0.31 } - - fg[ACTIVE] = { 0.80, 0.80, 0.80 } - bg[ACTIVE] = { 1.0, 0, 0} -} - -style "selected_io_selector_port_list" = "medium_bold_text" -{ - - GtkTreeView::even-row-color = { 0, 0, 0 } - GtkTreeView::odd-row-color = { 0, 0, 0 } - -# fg is used to color the fg (text) of the column header button - - fg[NORMAL] = { 0.85, 0.85, 0.85 } - fg[SELECTED] = { 0.85, 0.85, 0.85 } - fg[ACTIVE] = { 0.85, 0.85, 0.85 } - fg[PRELIGHT] = { 0.85, 0.85, 0.85 } - fg[INSENSITIVE] = { 0.85, 0.85, 0.85 } - -# bg is used used to color the background of the column header button - - bg[NORMAL] = { 0.30, 0.30, 0.35 } - bg[ACTIVE] = { 0.30, 0.30, 0.35 } - bg[PRELIGHT] = { 0.30, 0.30, 0.35 } - bg[INSENSITIVE] = { 0.30, 0.30, 0.35 } - bg[SELECTED] = { 0.30, 0.30, 0.35 } - -# text is used to color the treeview row text - - text[NORMAL] = { 0.85, 0.85, 0.85 } - text[SELECTED] = { 0.85, 0.85, 0.85 } - -# base is used to color a treeview with no rows - - base[NORMAL] = { 0.20, 0.20, 0.25 } - base[ACTIVE] = { 0.20, 0.20, 0.25 } - base[PRELIGHT] = { 0.20, 0.20, 0.25 } - base[INSENSITIVE] = { 0.20, 0.20, 0.25 } - base[SELECTED] = { 0.20, 0.20, 0.25 } - -} - -style "io_selector_port_list" = "medium_text" -{ - GtkTreeView::even-row-color = { 0.20, 0.20, 0.25 } - GtkTreeView::odd-row-color = { 0.20, 0.20, 0.25 } -# fg is used to color the fg (text) of the column header button - - fg[NORMAL] = { 0.70, 0.70, 0.70 } - fg[SELECTED] = { 0.70, 0.70, 0.70 } - fg[ACTIVE] = { 0.70, 0.70, 0.70 } - fg[PRELIGHT] = { 0.70, 0.70, 0.70 } - fg[INSENSITIVE] = { 0.70, 0.70, 0.70 } - -# bg is used used to color the background of the column header button - - bg[NORMAL] = { 0.30, 0.30, 0.35 } - bg[ACTIVE] = { 0.30, 0.30, 0.35 } - bg[PRELIGHT] = { 0.30, 0.30, 0.35 } - bg[INSENSITIVE] = { 0.30, 0.30, 0.35 } - bg[SELECTED] = { 0.30, 0.30, 0.35 } - -# text is used to color the treeview row text - - text[NORMAL] = { 0.80, 0.80, 0.80 } - text[SELECTED] = { 0.80, 0.80, 0.80 } - -# base is used to color a treeview with no rows - - base[NORMAL] = { 0.20, 0.20, 0.25 } - base[ACTIVE] = { 0.20, 0.20, 0.25 } - base[PRELIGHT] = { 0.20, 0.20, 0.25 } - base[INSENSITIVE] = { 0.20, 0.20, 0.25 } - base[SELECTED] = { 0.20, 0.20, 0.25 } -} - -style "io_selector_notebook" = "default_base" -{ - fg[NORMAL] = { 1.0, 1.0, 1.0 } - font_name ="sans bold 8" + xthickness = 1 + ythickness = 1 } style "tearoff_arrow" = "medium_bold_entry" @@ -1077,420 +101,19 @@ style "tearoff_arrow" = "medium_bold_entry" bg[PRELIGHT] = { 0.80, 0.80, 0.80 } } -style "meter_metrics_strip" = "default_base" -{ - font_name = "sans 4" - fg[NORMAL] = { 1.0, 0.8, 0.2 } -} - -style "location_row_button" = "default_buttons_menus" -{ - font_name = "sans 10" -} - -style "location_rows_clock" = "default_clock_display" -{ - font_name = "sans 12" -} - -style "pan_slider" -{ - font_name = "sans 8" - - fg[NORMAL] = { 0.22, 0.73, 0.22 } - fg[ACTIVE] = { 0.22, 0.73, 0.22 } - fg[INSENSITIVE] = {0.22, 0.53, 0.22 } - fg[SELECTED] = { 0.67, 0.23, 0.22 } - fg[PRELIGHT] = { 0.67, 0.23, 0.22 } - - bg[NORMAL] = { 0.05, 0.05, 0.05 } - bg[ACTIVE] = { 0, 0, 0 } - bg[INSENSITIVE] = {0.12, 0.19, 0.25 } - bg[SELECTED] = { 0, 0, 0 } - bg[PRELIGHT] = { 0, 0, 0 } - - text[NORMAL] = { 0.70, 0.70, 0.70 } - text[ACTIVE] = { 0.70, 0.70, 0.70 } - text[INSENSITIVE] = { 0.70, 0.70, 0.70 } - text[SELECTED] = { 0.70, 0.70, 0.70 } - text[PRELIGHT] = { 0.70, 0.70, 0.70 } - - # used to draw the triangular indicators - - base[NORMAL] = { 0.80, 0.80, 0.80 } - base[ACTIVE] = { 0.80, 0.80, 0.80 } - base[INSENSITIVE] = {0.6, 0.6, 0.6 } - base[SELECTED] = { 0.80, 0.80, 0.80 } - base[PRELIGHT] = { 0.80, 0.80, 0.80 } - -} - -style "ardour_button" ="default_buttons_menus" -{ - xthickness = 1 - ythickness = 1 -} - -#--------------------------------------------------------------- - class "GtkWidget" style:highest "default_base" -class "GtkScrollbar" style:highest "ardour_adjusters" +class "GtkScrollbar" style:highest "lumiera_adjusters" class "GtkLabel" style:highest "default_buttons_menus" -class "GtkButton" style:highest "ardour_button" +class "GtkButton" style:highest "lumiera_button" class "GtkArrow" style:highest "tearoff_arrow" -class "GtkProgressBar" style:highest "ardour_progressbars" +class "GtkProgressBar" style:highest "lumiera_progressbars" -widget "*FirstActionMessage" style:highest "first_action_message" -widget "*VerboseCanvasCursor" style:highest "verbose_canvas_cursor" -widget "*MarkerText" style:highest "marker_text" -widget "*TimeAxisViewItemName*" style:highest "time_axis_view_item_name" -#widget "*ExportProgress" style:highest "default_buttons_menus" -widget "*ExportFileLabel" style:highest "small_bold_text" -widget "*ExportFormatLabel" style:highest "medium_bold_text" -widget "*ExportHeader" style:highest "small_bold_text" -widget "*ExportFileDisplay" style:highest "medium_entry" -widget "*ExportFormatDisplay" style:highest "medium_entry" -widget "*ExportCheckbox" style:highest "small_entry" -widget "*ExportTrackSelector*" style:highest "medium_entry_noselection_bg" -widget "*EditModeSelector" style:highest "medium_bold_entry" -widget "*SnapTypeSelector" style:highest "medium_bold_entry" -widget "*SnapModeSelector" style:highest "medium_bold_entry" -widget "*ZoomFocusSelector" style:highest "medium_bold_entry" -widget "*ArdourContextMenu*" style:highest "default_buttons_menus" -widget "*EditGroupTitleButton*" style:highest "default_buttons_menus" -widget "*MixerGroupTitleButton*" style:highest "default_buttons_menus" -widget "*ErrorLogCloseButton" style:highest "default_buttons_menus" -widget "*EditorGTKButton*" style:highest "default_buttons_menus" -widget "*ToolbarButton" style:highest "default_buttons_menus" -widget "*ToolbarButton*" style:highest "default_buttons_menus" -widget "*CrossfadeEditButton" style:highest "default_buttons_menus" -widget "*CrossfadeEditButton*" style:highest "default_buttons_menus" -widget "*TrackHistoryButton*" style:highest "default_buttons_menus" -widget "*TrackSizeButton*" style:highest "default_buttons_menus" -widget "*TrackPlaylistButton*" style:highest "default_buttons_menus" -widget "*TrackAutomationButton*" style:highest "default_buttons_menus" -widget "*TrackGroupButton*" style:highest "default_buttons_menus" -widget "*TrackMixButton*" style:highest "default_buttons_menus" -widget "*TrackVisualButton*" style:highest "default_buttons_menus" -widget "*TrackRemoveButton*" style:highest "default_buttons_menus" -widget "*BaseButton" style:highest "default_buttons_menus" -widget "*TakeButtonLabel" style:highest "default_buttons_menus" -widget "*MixerWidthButton" style:highest "default_buttons_menus" -widget "*MixerHideButton" style:highest "default_buttons_menus" -widget "*MixerSendButton" style:highest "default_buttons_menus" -widget "*MixerSendButtonLabel" style:highest "default_buttons_menus" -widget "*MixerSendSwitch" style:highest "default_buttons_menus" -widget "*MixerInsertButton" style:highest "default_buttons_menus" -widget "*MixerInsertButtonLabel" style:highest "default_buttons_menus" -widget "*MixerInsertSwitch" style:highest "default_buttons_menus" -widget "*MixerMonitorInputButton*" style:highest "very_small_button" -widget "*MixerMonitorInputButton.*" style:highest "very_small_button" -widget "*MixerIOButton" style:highest "very_small_button" -widget "*MixerIOButtonLabel" style:highest "very_small_button" -widget "*AddRouteDialogSpinner" style:highest "ardour_adjusters" -widget "*AddRouteDialogRadioButton*" style:highest "options_window" -widget "*OptionsNotebook" style:highest "options_window" -widget "*OptionEditorToggleButton*" style:highest "options_window" -widget "*OptionsLabel" style:highest "options_window" -widget "*OptionEditorAuditionerLabel" style:highest "options_window" -widget "*OptionsEntry" style:highest "option_entry" -widget "*InspectorNotebook" style:highest "options_window" -widget "*NewSessionDialog" style:highest "options_window" -widget "*NewSessionDialogButton*" style:highest "options_window" -widget "*MixerSendSwitch*" style:highest "very_small_red_active_and_selected_button" -widget "*OptionEditorToggleButton" style:highest "small_red_active_and_selected_button" -widget "*NewSessionDialogButton" style:highest "small_red_active_and_selected_button" -widget "*RecordEnableButton" style:highest "track_rec_enable_button" -widget "*RecordEnableButton-active" style:highest "track_rec_enable_button_active" -widget "*RecordEnableButton-alternate" style:highest "track_rec_enable_button_alternate" -widget "*MixerRecordEnableButton" style:highest "mixer_track_rec_enable_button" -widget "*MixerRecordEnableButton-active" style:highest "mixer_track_rec_enable_button_active" -widget "*MixerRecordEnableButton-alternate" style:highest "mixer_track_rec_enable_button_alternate" -widget "*MuteButton" style:highest "mute_button" -widget "*MuteButton-alternate" style:highest "mute_button_alternate" -widget "*MuteButton-active" style:highest "mute_button_active" -widget "*MixerMuteButton" style:highest "mixer_mute_button" -widget "*MixerMuteButton-alternate" style:highest "mixer_mute_button_alternate" -widget "*MixerMuteButton-active" style:highest "mixer_mute_button_active" -widget "*SoloButton" style:highest "solo_button" -widget "*SoloButton-alternate" style:highest "solo_button_alternate" -widget "*SoloButton-active" style:highest "solo_button_active" -widget "*MixerSoloButton" style:highest "mixer_solo_button" -widget "*MixerSoloButton-alternate" style:highest "mixer_solo_button_alternate" -widget "*MixerSoloButton-active" style:highest "mixer_solo_button_active" -widget "*TrackLoopButton*" style:highest "track_loop_button" -widget "*PanAutomationLineSelector*" style:highest "multiline_combo" -widget "*EditorTimeButton*" style:highest "time_button" -widget "*MixerPhaseInvertButton*" style:highest "very_small_button" -widget "*MixerPhaseInvertButton.*" style:highest "very_small_button" -widget "*MixerAutomationRecordingButton*" style:highest "very_small_button" -widget "*MixerAutomationRecordingButton.*" style:highest "very_small_button" -widget "*MixerAutomationModeButton*" style:highest "very_small_button" -widget "*MixerAutomationModeButton.*" style:highest "very_small_button" -widget "*MixerAutomationPlaybackButton*" style:highest "very_small_button" -widget "*MixerAutomationPlaybackButton.*" style:highest "very_small_button" -widget "*MixerNameButton" style:highest "very_small_button" -widget "*MixerNameButtonLabel" style:highest "very_small_button" -widget "*MixerGroupButton" style:highest "very_small_button" -widget "*MixerGroupButtonLabel" style:highest "very_small_button" -widget "*MixerCommentButton" style:highest "very_small_button" -widget "*MixerCommentButton*" style:highest "very_small_button" -widget "*EditGroupButton" style:highest "very_small_button" -widget "*EditGroupButtonLabel" style:highest "very_small_button" -widget "*TransportButton" style:highest "transport_rec_button" -widget "*TransportButton-active" style:highest "transport_button_active" -widget "*ShuttleButton" style:highest "transport_button" -widget "*ShuttleButton*" style:highest "transport_button" -widget "*ShuttleDisplay" style:highest "transport_button" -widget "*ShuttleDisplay*" style:highest "transport_button" -widget "*ShuttleControl" style:highest "shuttle_control" -widget "*TransportRecButton" style:highest "transport_rec_button" -widget "*TransportRecButton*" style:highest "transport_rec_button" -widget "*TransportRecButton-active" style:highest "transport_rec_button_active" -widget "*TransportRecButton-active*" style:highest "transport_rec_button_active" -widget "*TransportRecButton-alternate" style:highest "transport_rec_button_alternate" -widget "*TransportRecButton-alternate*" style:highest "transport_rec_button_alternate" -widget "*TransportRecButton*" style:highest "transport_rec_button" -widget "*RecordingXrunWarningWindow" style:highest "xrun_warn" -widget "*RecordingXrunWarningWindow*" style:highest "xrun_warn" -widget "*MainMenuBar" style:highest "menu_bar_base" -widget "*ErrorMessage" style:highest "error_message" -widget "*FatalMessage" style:highest "fatal_message" -widget "*InfoMessage" style:highest "info_message" -widget "*WarningMessage" style:highest "warning_message" -widget "*BigClockNonRecording" style:highest "non_recording_big_clock_display" -widget "*BigClockRecording" style:highest "recording_big_clock_display" -widget "*TransportClockDisplay" style:highest "transport_clock_display" -widget "*SecondaryClockDisplay" style:highest "transport_clock_display" -widget "*AudioClockFramesUpperInfo" style:highest "tempo_meter_clock_display" -widget "*AudioClockFramesLowerInfo" style:highest "tempo_meter_clock_display" -widget "*AudioClockSMPTEUpperInfo" style:highest "tempo_meter_clock_display" -widget "*AudioClockSMPTELowerInfo" style:highest "tempo_meter_clock_display" -widget "*AudioClockBBTUpperInfo" style:highest "tempo_meter_clock_display" -widget "*AudioClockBBTLowerInfo" style:highest "tempo_meter_clock_display" -widget "*SelectionStartClock" style:highest "default_clock_display" -widget "*SelectionEndClock" style:highest "default_clock_display" -widget "*EditCursorClock" style:highest "default_clock_display" -widget "*PreRollClock" style:highest "default_clock_display" -widget "*PostRollClock" style:highest "default_clock_display" -widget "*NudgeClock" style:highest "default_clock_display" -widget "*ZoomRangeClock" style:highest "default_clock_display" -widget "*SMPTEOffsetClock" style:highest "default_clock_display" -widget "*TransportLabel" style:highest "small_bold_text" -widget "*TakeLabel" style:highest "small_bold_text" -widget "*LocationLabel" style:highest "small_bold_text" -widget "*WipeLabel" style:highest "small_bold_text" -widget "*TakeTagLabel" style:highest "small_bold_text" -widget "*ToolBarLabel" style:highest "small_bold_text" -widget "*EditorDisplayLabel" style:highest "small_bold_text" -widget "*NewSessionLabel" style:highest "large_text" -widget "*GlobalButtonLabel" style:highest "default_buttons_menus" -widget "*ClickButton" style:highest "medium_entry" -widget "*RegionNameDisplay" style:highest "medium_entry" -widget "*PluginDisplay" style:highest "medium_entry" -widget "*SelectionDisplay" style:highest "medium_entry" -widget "*HistorySelector" style:highest "medium_entry" -widget "*LocationSelector" style:highest "medium_entry" -widget "*TakeSelector" style:highest "medium_entry" -widget "*RegionSelector" style:highest "medium_entry" -widget "*SMPTERuler" style:highest "editor_time_ruler" -widget "*BBTRuler" style:highest "editor_time_ruler" -widget "*FramesRuler" style:highest "editor_time_ruler" -widget "*MinSecRuler" style:highest "editor_time_ruler" -widget "*BaseFrame" style:highest "base_frame" -widget "*AudioTrackStripBase" style:highest "audio_track_base" -widget "*TimeAxisViewControlsBaseUnselected" style:highest "audio_track_base" -widget "*AudioTrackControlsBaseUnselected" style:highest "audio_track_base" -widget "*AudioTrackFader" style:highest "gain_fader" -widget "*AudioBusStripBase" style:highest "audio_bus_base" -widget "*BusControlsBaseUnselected" style:highest "audio_bus_base" -widget "*AudioBusFader" style:highest "gain_fader" -widget "*TrackSeparator" style:highest "track_separator" -widget "*TrackEditIndicator0*" style:highest "edit_group_0" -widget "*TrackEditIndicator1*" style:highest "edit_group_1" -widget "*TrackEditIndicator2*" style:highest "edit_group_2" -widget "*TrackEditIndicator3*" style:highest "edit_group_3" -widget "*TrackEditIndicator4*" style:highest "edit_group_3" -widget "*TrackEditIndicator5*" style:highest "edit_group_3" -widget "*TrackEditIndicator6*" style:highest "edit_group_3" -widget "*TrackEditIndicator7*" style:highest "edit_group_3" -widget "*EditorTrackNameDisplay" style:highest "track_name_display" -widget "*EditorTrackNameDisplay*" style:highest "track_name_display" -widget "*EditorActiveTrackNameDisplay" style:highest "active_track_name_display" -widget "*EditorActiveTrackNameDisplay*" style:highest "active_track_name_display" -widget "*CrossfadeEditAuditionButton" style:highest "red_when_active" -widget "*CrossfadeEditAuditionButton*" style:highest "red_when_active" -widget "*CrossfadeEditCurveButton" style:highest "red_when_active" -widget "*CrossfadeEditCurveButton*" style:highest "red_when_active" -widget "*CrossfadeEditLabel" style:highest "medium_text" -widget "*CrossfadeEditFrame" style:highest "base_frame" -widget "*MouseModeButton" style:highest "default_buttons_menus" -widget "*MouseModeButton*" style:highest "default_buttons_menus" -widget "*EditorMainCanvas" style:highest "main_canvas_area" -widget "*AudioTrackControlsBaseInactiveUnselected" style:highest "track_controls_inactive" -widget "*BusControlsBaseInactiveUnselected" style:highest "track_controls_inactive" -widget "*AutomationTrackControlsBaseInactiveUnselected" style:highest "track_controls_inactive" -widget "*AutomationTrackName" style:highest "automation_track_name" -widget "*AudioTrackControlsBaseInactiveSelected" style:highest "track_controls_inactive" -widget "*BusControlsBaseInactiveSelected" style:highest "track_controls_inactive" -widget "*AutomationTrackControlsBaseInactiveSelected" style:highest "track_controls_inactive" -widget "*AudioTrackStripBaseInactive" style:highest "track_controls_inactive" -widget "*AudioBusStripBaseInactive" style:highest "track_controls_inactive" -widget "*AudioTrackControlsBaseSelected" style:highest "edit_controls_base_selected" -widget "*BusControlsBaseSelected" style:highest "edit_controls_base_selected" -widget "*AutomationTrackControlsBase" style:highest "automation_track_controls_base" -widget "*AutomationTrackControlsBaseSelected" style:highest "edit_controls_base_selected" -widget "*EditorMenuBar*" style:highest "black_mackie_menu_bar" -widget "*MainMenuBar*" style:highest "black_mackie_menu_bar" -widget "*ZoomClickBox" style:highest "medium_bold_entry" -widget "*PluginParameterLabel" style:highest "medium_text" -widget "*PluginNameInfo" style:highest "plugin_name_text" -widget "*PluginMakerInfo" style:highest "plugin_maker_text" -widget "*PluginParameterInfo" style:highest "medium_text" -widget "*MotionControllerValue" style:highest "medium_entry" -widget "*ParameterValueDisplay" style:highest "medium_bold_entry" -widget "*PluginUIClickBox" style:highest "medium_bold_entry" -widget "*PluginUIClickBox*" style:highest "medium_bold_entry" -widget "*PluginSlider" style:highest "plugin_slider" -widget "*RedirectSelector" style:highest "redirect_list_display" -widget "*RedirectSelector.*" style:highest "redirect_list_display" -widget "*EditGroupDisplay" style:highest "treeview_display" -widget "*TrackListDisplay" style:highest "treeview_display" -widget "*RegionListDisplay" style:highest "treeview_display" -widget "*NamedSelectionDisplay" style:highest "treeview_display" -widget "*SnapshotDisplay" style:highest "treeview_display" -widget "*MixerTrackCommentArea" style:highest "option_entry" -widget "*MixerPanZone" style:highest "pan_zone" -widget "*MixerTrackDisplayList" style:highest "treeview_display" -widget "*MixerSnapshotDisplayList" style:highest "treeview_display" -widget "*MixerAuxDisplayList" style:highest "treeview_display" -widget "*MixerGroupList" style:highest "treeview_display" -widget "*RegionEditorLabel" style:highest "medium_text" -widget "*RegionEditorSmallLabel" style:highest "small_text" -widget "*RegionEditorEntry" style:highest "medium_entry" -widget "*RegionEditorClock" style:highest "default_clock_display" -widget "*RegionEditorToggleButton" style:highest "paler_red_when_active" -widget "*RegionEditorToggleButton*" style:highest "paler_red_when_active" -widget "*MixerStripSpeedBase" style:highest "small_entry" -widget "*MixerStripSpeedBase*" style:highest "small_entry" -widget "*MixerStripSpeedBaseNotOne" style:highest "small_red_on_black_entry" -widget "*MixerStripSpeedBaseNotOne*" style:highest "small_red_on_black_entry" -widget "*MixerStripGainDisplay" style:highest "small_entry" -widget "*MixerStripGainDisplay*" style:highest "small_entry" -widget "*MixerStripGainUnitButton" style:highest "very_small_button" -widget "*MixerStripGainUnitButton*" style:highest "very_small_button" -widget "*MixerStripMeterPreButton" style:highest "very_small_button" -widget "*MixerStripMeterPreButton*" style:highest "very_small_button" -widget "*MixerStripPeakDisplay*" style:highest "red_active_small_entry" -widget "*MixerStripPeakDisplayPeak*" style:highest "peak_display_peaked_entry" -widget "*MixerStripSelectedFrame" style:highest "selected_strip_frame" -widget "*MixerStripFrame" style:highest "base_frame" -widget "*HWMonitorButton" style:highest "red_when_active" -widget "*HWMonitorButton*" style:highest "red_when_active" -widget "*BypassButton" style:highest "red_when_active" -widget "*BypassButton*" style:highest "red_when_active" -widget "*TransportSoloAlert" style:highest "flashing_alert" -widget "*TransportSoloAlert.*" style:highest "flashing_alert" -widget "*TransportAuditioningAlert" style:highest "flashing_alert" -widget "*TransportAuditioningAlert.*" style:highest "flashing_alert" -widget "*FadeCurve" style:highest "medium_bold_entry" -widget "*FadeCurve*" style:highest "medium_bold_entry" -widget "*IOSelectorButton" style:highest "default_buttons_menus" -widget "*IOSelectorButton*" style:highest "default_buttons_menus" -widget "*IOSelectorList" style:highest "medium_entry_noselection_fg" -widget "*IOSelectorPortList" style:highest "io_selector_port_list" -widget "*IOSelectorPortList.*" style:highest "io_selector_port_list" -widget "*IOSelectorPortListSelected" style:highest "selected_io_selector_port_list" -widget "*IOSelectorPortListSelected.*" style:highest "selected_io_selector_port_list" -widget "*IOSelectorNotebook" style:highest "io_selector_notebook" -widget "*IOSelectorNotebookTab" style:highest "io_selector_notebook" -widget "*IOSelectorFrame" style:highest "base_frame" -widget "*ConnectionEditorButton" style:highest "default_buttons_menus" -widget "*ConnectionEditorButton*" style:highest "default_buttons_menus" -widget "*ConnectionEditorList" style:highest "medium_entry_noselection_fg" -widget "*ConnectionEditorConnectionList" style:highest "medium_entry" -widget "*ConnectionEditorPortList" style:highest "io_selector_port_list" -widget "*ConnectionEditorPortListSelected" style:highest "selected_io_selector_port_list" -widget "*ConnectionEditorNotebook" style:highest "io_selector_notebook" -widget "*ConnectionEditorNotebookTab" style:highest "io_selector_notebook" -widget "*ConnectionEditorFrame" style:highest "base_frame" -widget "*RouteParamsListDisplay" style:highest "inspector_track_list_display" -widget "*RouteParamsPreListDisplay" style:highest "inspector_redirect_list_display" -widget "*RouteParamsPostListDisplay" style:highest "inspector_redirect_list_display" -widget "*TearOffArrow" style:highest "tearoff_arrow" -widget "*RouteParamsTitleButton" style:highest "medium_text" -widget "*RouteParamsTitleLabel" style:highest "medium_text" -widget "*PluginAutomateRecordButton" style:highest "small_red_active_and_selected_button" -widget "*PluginAutomateRecordButton*" style:highest "small_red_active_and_selected_button" -widget "*PluginAutomatePlayButton" style:highest "small_red_active_and_selected_button" -widget "*PluginAutomatePlayButton*" style:highest "small_red_active_and_selected_button" -widget "*PluginAutomateButton" style:highest "small_button" -widget "*PluginAutomateButton*" style:highest "small_button" -widget "*PluginSaveButton" style:highest "small_button" -widget "*PluginSaveButton*" style:highest "small_button" -widget "*PluginLoadButton" style:highest "small_button" -widget "*PluginLoadButton*" style:highest "small_button" -widget "*FaderMetricsStrip" style:highest "meter_metrics_strip" -widget "*MeterMetricsStrip" style:highest "meter_metrics_strip" -widget "*MetricDialogFrame" style:highest "base_frame" -widget "*MetricEntry" style:highest "medium_bold_entry" -widget "*MetricButton" style:highest "default_buttons_menus" -widget "*MetricButton.*" style:highest "default_buttons_menus" -widget "*MetricLabel" style:highest "medium_text" -widget "*TimeStretchButton" style:highest "default_buttons_menus" -widget "*TimeStretchButton.*" style:highest "default_buttons_menus" -widget "*TimeStretchProgress" style:highest "default_buttons_menus" -widget "*ChoiceWindow" style:highest "default_buttons_menus" -widget "*ChoicePrompt" style:highest "default_buttons_menus" -widget "*ChoiceButton" style:highest "default_buttons_menus" -widget "*ChoiceButton*" style:highest "default_buttons_menus" -widget "*SelectionModeButton" style:highest "default_buttons_menus" -widget "*SelectionModeButton*" style:highest "default_buttons_menus" -widget "*TrackLabel" style:highest "medium_text" -widget "*TrackPlugName" style:highest "medium_text" -widget "*TrackParameterName" style:highest "small_text" -widget "*AddRouteDialog*" style:highest "medium_text" -widget "*AddRouteDialog.GtkLabel" style:highest "medium_text" -widget "*AddRouteDialogChannelChoice" style:highest "medium_bold_entry" -widget "*AddRouteDialogSpinner" style:highest "medium_bold_entry" -widget "*AddRouteDialogSpinner*" style:highest "medium_bold_entry" -widget "*AddRouteDialogRadioButton" style:highest "red_when_active" -widget "*AddRouteDialogButton" style:highest "default_buttons_menus" -widget "*AddRouteDialogNameTemplateEntry" style:highest "medium_bold_entry" -widget "*NewSessionIOLabel" style:highest "larger_bold_text" -widget "*NewSessionSR1Label" style:highest "red_medium_text" -widget "*NewSessionSR2Label" style:highest "medium_text" -widget "*NewSessionChannelChoice" style:highest "medium_bold_entry" -widget "*NewSessionMainButton" style:highest "larger_bold_text" -widget "*NewSessionMainButton*" style:highest "larger_bold_text" -widget "*NewSessionMainLabel" style:highest "larger_bold_text" -widget "*LocationEditRowClock" style:highest "location_rows_clock" -widget "*LocationEditNameLabel" style:highest "medium_text" -widget "*LocationEditSetButton" style:highest "location_row_button" -widget "*LocationEditSetButton*" style:highest "location_row_button" -widget "*LocationEditGoButton" style:highest "location_row_button" -widget "*LocationEditGoButton*" style:highest "location_row_button" -widget "*LocationEditCdButton" style:highest "small_red_active_and_selected_button" -widget "*LocationEditCdButton*" style:highest "small_red_active_and_selected_button" -widget "*LocationEditHideButton" style:highest "small_red_active_and_selected_button" -widget "*LocationEditHideButton*" style:highest "small_red_active_and_selected_button" -widget "*LocationEditNumberLabel" style:highest "small_text" -widget "*LocationLocEditorFrame" style:highest "base_frame" -widget "*LocationRangeEditorFrame" style:highest "base_frame" -widget "*LocationEditNameEntry" style:highest "option_entry" -widget "*LocationAddLocationButton" style:highest "default_buttons_menus" -widget "*LocationAddLocationButton*" style:highest "default_buttons_menus" -widget "*LocationAddRangeButton" style:highest "default_buttons_menus" -widget "*LocationAddRangeButton*" style:highest "default_buttons_menus" -widget "*LocationEditRemoveButton" style:highest "location_row_button" -widget "*LocationEditRemoveButton*" style:highest "location_row_button" -widget "*PanSlider" style:highest "pan_slider" -widget "*PanningLinkButton" style:highest "mixer_red_active_button" -widget "*PanningLinkButton.*" style:highest "mixer_red_active_button" -widget "*PanningLinkDirectionButton" style:highest "very_small_button" -widget "*PanningLinkDirectionButton.*" style:highest "very_small_button" -widget "*ChannelCountSelector" style:highest "medium_bold_entry" -widget "*ChannelCountSelector.GtkArrow" style:highest "default_buttons_menus" -widget "*RegionListWholeFile" style:highest "treeview_parent_node" -widget "*EditorHScrollbar" style:highest "editor_hscrollbar" +#---------- Styles for Lumiera Widgets ----------# + +style "timeline_body" +{ + gtkmm__CustomObject_TimelineBody::track_background = "#FF7F00" +} + +class "gtkmm__CustomObject_TimelineBody" style:highest "timeline_body" diff --git a/src/gui/widgets/timeline-widget.cpp b/src/gui/widgets/timeline-widget.cpp index 3665ec98b..163ea60c1 100644 --- a/src/gui/widgets/timeline-widget.cpp +++ b/src/gui/widgets/timeline-widget.cpp @@ -41,7 +41,7 @@ TimelineWidget::TimelineWidget() : { rowHeaderLayout.set_size_request(100, 100); - body = new TimelineBody(horizontalAdjustment, verticalAdjustment); + body = new TimelineBody(this); verticalAdjustment.signal_value_changed().connect( sigc::mem_fun(this, &TimelineWidget::on_scroll) ); diff --git a/src/gui/widgets/timeline/timeline-body.cpp b/src/gui/widgets/timeline/timeline-body.cpp index f3e204cf9..f7e747f55 100644 --- a/src/gui/widgets/timeline/timeline-body.cpp +++ b/src/gui/widgets/timeline/timeline-body.cpp @@ -23,6 +23,7 @@ #include #include "timeline-body.hpp" +#include "../timeline-widget.hpp" using namespace Gtk; using namespace std; @@ -33,13 +34,26 @@ namespace gui { namespace widgets { namespace timeline { -TimelineBody::TimelineBody(lumiera::gui::widgets::TimelineWidget &timeline_widget) : +TimelineBody::TimelineBody(lumiera::gui::widgets::TimelineWidget *timeline_widget) : + Glib::ObjectBase("TimelineBody"), timelineWidget(timeline_widget) { - timelineWidget.horizontalAdjustment.signal_value_changed().connect( + g_assert(timelineWidget != NULL); + + // Connect up some events + timelineWidget->horizontalAdjustment.signal_value_changed().connect( sigc::mem_fun(this, &TimelineBody::on_scroll) ); - timelineWidget.verticalAdjustment.signal_value_changed().connect( + timelineWidget->verticalAdjustment.signal_value_changed().connect( sigc::mem_fun(this, &TimelineBody::on_scroll) ); + + // Install style properties + gtk_widget_class_install_style_property( + GTK_WIDGET_CLASS(G_OBJECT_GET_CLASS(gobj())), + g_param_spec_boxed("track_background", + "Track Background", + "The background colour of timeline tracks", + GDK_TYPE_COLOR, G_PARAM_READABLE)); + } void @@ -53,32 +67,64 @@ TimelineBody::on_expose_event(GdkEventExpose* event) { // This is where we draw on the window Glib::RefPtr window = get_window(); - if(window) + if(!window) + return false; + + read_styles(); + + + Gtk::Allocation allocation = get_allocation(); + const int width = allocation.get_width(); + const int height = allocation.get_height(); + + Cairo::RefPtr cairo = window->create_cairo_context(); + cairo->set_line_width(10.0); + + cairo->rectangle(50, 50, 100, 100); + gdk_cairo_set_source_color(cairo->cobj(), &track_background); + + cairo->fill_preserve(); + + + cairo->translate( + -timelineWidget->horizontalAdjustment.get_value(), + -timelineWidget->verticalAdjustment.get_value()); + cairo->save(); + + vector::iterator i; + for(i = timelineWidget->tracks.begin(); + i != timelineWidget->tracks.end(); i++) { - Gtk::Allocation allocation = get_allocation(); - const int width = allocation.get_width(); - const int height = allocation.get_height(); - - Cairo::RefPtr cr = window->create_cairo_context(); - cr->set_line_width(10.0); - - cr->translate(-horizontalAdjustment.get_value(), -verticalAdjustment.get_value()); - cr->save(); - - vector::iterator i; - for(i = tracks.begin(); i != tracks.end(); i++) - { - timeline::Track *track = *i; - g_assert(track != NULL); - track->draw_track(); - } - - cr->restore(); + timeline::Track *track = *i; + g_assert(track != NULL); + track->draw_track(cairo); } + cairo->restore(); + return true; } + +void +TimelineBody::read_styles() +{ + GdkColor *colour; + + gtk_widget_style_get(Widget::gobj(), "track_background", &colour, NULL); + + // Did the color load successfully? + if(colour != NULL) + track_background = *colour; + else + { + g_warning("track_background style value failed to load"); + track_background.red = 0x0000; + track_background.green = 0x0000; + track_background.blue = 0x0000; + track_background.pixel = 0x00000000; + } +} } // namespace timeline } // namespace widgets diff --git a/src/gui/widgets/timeline/timeline-body.hpp b/src/gui/widgets/timeline/timeline-body.hpp index 39fd8773a..c58323b1b 100644 --- a/src/gui/widgets/timeline/timeline-body.hpp +++ b/src/gui/widgets/timeline/timeline-body.hpp @@ -31,21 +31,31 @@ namespace lumiera { namespace gui { namespace widgets { + +class TimelineWidget; + namespace timeline { class TimelineBody : public Gtk::DrawingArea { public: - TimelineBody(lumiera::gui::widgets::TimelineWidget &timeline_widget); + TimelineBody(lumiera::gui::widgets::TimelineWidget *timeline_widget); protected: - lumiera::gui::widgets::TimelineWidget &timelineWidget; + lumiera::gui::widgets::TimelineWidget *timelineWidget; /* ===== Events ===== */ protected: void on_scroll(); virtual bool on_expose_event(GdkEventExpose* event); + + /* ===== Internals ===== */ + private: + void read_styles(); + + private: + GdkColor track_background; }; } // namespace timeline diff --git a/src/gui/widgets/timeline/track.cpp b/src/gui/widgets/timeline/track.cpp index c0564e37f..510dfc798 100644 --- a/src/gui/widgets/timeline/track.cpp +++ b/src/gui/widgets/timeline/track.cpp @@ -39,7 +39,7 @@ Track::get_title() } void -Track::draw_track() +Track::draw_track(Cairo::RefPtr cairo) { } diff --git a/src/gui/widgets/timeline/track.hpp b/src/gui/widgets/timeline/track.hpp index 204b650a0..15254ea00 100644 --- a/src/gui/widgets/timeline/track.hpp +++ b/src/gui/widgets/timeline/track.hpp @@ -44,7 +44,7 @@ class Track virtual int get_track_height() = 0; - virtual void draw_track(); + virtual void draw_track(Cairo::RefPtr cairo); protected: diff --git a/src/gui/widgets/timeline/video-track.cpp b/src/gui/widgets/timeline/video-track.cpp index b3b45c543..6fd55fea5 100644 --- a/src/gui/widgets/timeline/video-track.cpp +++ b/src/gui/widgets/timeline/video-track.cpp @@ -45,7 +45,7 @@ int VideoTrack::get_track_height() return 100; } -void VideoTrack::draw_track() +void VideoTrack::draw_track(Cairo::RefPtr cairo) { } diff --git a/src/gui/widgets/timeline/video-track.hpp b/src/gui/widgets/timeline/video-track.hpp index e82a178bd..d73a03b6e 100644 --- a/src/gui/widgets/timeline/video-track.hpp +++ b/src/gui/widgets/timeline/video-track.hpp @@ -42,7 +42,7 @@ class VideoTrack : public Track virtual int get_track_height(); - virtual void draw_track(); + virtual void draw_track(Cairo::RefPtr cairo); protected: Gtk::Label headerWidget; From e9747b360cd626ace1f04f357215411a90fdec14 Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Sat, 31 May 2008 18:21:05 +0100 Subject: [PATCH 050/110] Track backgrounds are now painted from the style --- src/gui/lumiera_ui.rc | 2 +- src/gui/widgets/timeline-widget.cpp | 6 ++- src/gui/widgets/timeline-widget.hpp | 4 ++ src/gui/widgets/timeline/timeline-body.cpp | 52 ++++++++++++---------- 4 files changed, 37 insertions(+), 27 deletions(-) diff --git a/src/gui/lumiera_ui.rc b/src/gui/lumiera_ui.rc index f0c1163e5..f37b4c12b 100644 --- a/src/gui/lumiera_ui.rc +++ b/src/gui/lumiera_ui.rc @@ -112,7 +112,7 @@ class "GtkProgressBar" style:highest "lumiera_progressbars" style "timeline_body" { - gtkmm__CustomObject_TimelineBody::track_background = "#FF7F00" + gtkmm__CustomObject_TimelineBody::track_background = "#7E838B" } class "gtkmm__CustomObject_TimelineBody" style:highest "timeline_body" diff --git a/src/gui/widgets/timeline-widget.cpp b/src/gui/widgets/timeline-widget.cpp index 163ea60c1..e448f62f2 100644 --- a/src/gui/widgets/timeline-widget.cpp +++ b/src/gui/widgets/timeline-widget.cpp @@ -30,6 +30,8 @@ namespace lumiera { namespace gui { namespace widgets { +const int TimelineWidget::TrackPadding = 1; + TimelineWidget::TimelineWidget() : Table(2, 2), totalHeight(0), @@ -39,7 +41,7 @@ TimelineWidget::TimelineWidget() : verticalScroll(verticalAdjustment), ruler("ruler") { - rowHeaderLayout.set_size_request(100, 100); + rowHeaderLayout.set_size_request(100, 0); body = new TimelineBody(this); @@ -97,7 +99,7 @@ TimelineWidget::move_headers() const int height = track->get_track_height(); rowHeaderLayout.move(track->get_header_widget(), 0, offset - y_scroll_offset); - offset += height; + offset += height + TrackPadding; } totalHeight = offset; verticalAdjustment.set_upper(totalHeight); diff --git a/src/gui/widgets/timeline-widget.hpp b/src/gui/widgets/timeline-widget.hpp index 7ceb3f125..fb87f321b 100644 --- a/src/gui/widgets/timeline-widget.hpp +++ b/src/gui/widgets/timeline-widget.hpp @@ -69,6 +69,10 @@ class TimelineWidget : public Gtk::Table Gtk::Adjustment horizontalAdjustment, verticalAdjustment; Gtk::HScrollbar horizontalScroll; Gtk::VScrollbar verticalScroll; + + /* ===== Constants ===== */ + protected: + static const int TrackPadding; friend class timeline::TimelineBody; }; diff --git a/src/gui/widgets/timeline/timeline-body.cpp b/src/gui/widgets/timeline/timeline-body.cpp index f7e747f55..e7c9e0b78 100644 --- a/src/gui/widgets/timeline/timeline-body.cpp +++ b/src/gui/widgets/timeline/timeline-body.cpp @@ -27,6 +27,7 @@ using namespace Gtk; using namespace std; +using namespace lumiera::gui::widgets; using namespace lumiera::gui::widgets::timeline; namespace lumiera { @@ -69,41 +70,44 @@ TimelineBody::on_expose_event(GdkEventExpose* event) Glib::RefPtr window = get_window(); if(!window) return false; - - read_styles(); - - - Gtk::Allocation allocation = get_allocation(); - const int width = allocation.get_width(); - const int height = allocation.get_height(); - - Cairo::RefPtr cairo = window->create_cairo_context(); - cairo->set_line_width(10.0); - cairo->rectangle(50, 50, 100, 100); - gdk_cairo_set_source_color(cairo->cobj(), &track_background); - - cairo->fill_preserve(); - + // Makes sure the widget styles have been loaded + read_styles(); + + // Prepare to render via cairo + Gtk::Allocation allocation = get_allocation(); + Cairo::RefPtr cairo = window->create_cairo_context(); + // Translate the view by the scroll distance cairo->translate( - -timelineWidget->horizontalAdjustment.get_value(), - -timelineWidget->verticalAdjustment.get_value()); - cairo->save(); - + -(int)timelineWidget->horizontalAdjustment.get_value(), + -(int)timelineWidget->verticalAdjustment.get_value()); + + // Interate drawing each track vector::iterator i; for(i = timelineWidget->tracks.begin(); i != timelineWidget->tracks.end(); i++) { timeline::Track *track = *i; - g_assert(track != NULL); - track->draw_track(cairo); - } + g_assert(track != NULL); - cairo->restore(); + const int track_height = track->get_track_height(); + + // Draw the track background + cairo->rectangle(0, 0, allocation.get_width(), track_height); + gdk_cairo_set_source_color(cairo->cobj(), &track_background); + cairo->fill(); + + // Render the track + cairo->save(); + track->draw_track(cairo); + cairo->restore(); + + // Shift for the next track + cairo->translate(0, track_height + TimelineWidget::TrackPadding); + } return true; - } void From 0ac09411bcc834508816f7fa772dc8886e1ee70a Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Thu, 5 Jun 2008 20:27:53 +0100 Subject: [PATCH 051/110] Basic timeline with scrolling headers now works + Tidying work --- src/gui/Makefile.am | 2 + src/gui/lumiera_ui.rc | 19 +- src/gui/widgets/timeline-widget.cpp | 93 ++++++--- src/gui/widgets/timeline-widget.hpp | 19 +- src/gui/widgets/timeline/header-container.cpp | 193 ++++++++++++++++++ src/gui/widgets/timeline/header-container.hpp | 76 +++++++ src/gui/widgets/timeline/timeline-body.cpp | 32 +-- src/gui/widgets/timeline/timeline-body.hpp | 5 +- src/gui/widgets/timeline/track.cpp | 6 + src/gui/widgets/timeline/track.hpp | 3 +- src/gui/widgets/timeline/video-track.cpp | 18 +- src/gui/widgets/timeline/video-track.hpp | 3 +- src/gui/widgets/video-display-widget.cpp | 160 +++++++-------- 13 files changed, 480 insertions(+), 149 deletions(-) create mode 100644 src/gui/widgets/timeline/header-container.cpp create mode 100644 src/gui/widgets/timeline/header-container.hpp diff --git a/src/gui/Makefile.am b/src/gui/Makefile.am index b498fa3e8..fe4a1543f 100644 --- a/src/gui/Makefile.am +++ b/src/gui/Makefile.am @@ -58,6 +58,8 @@ lumigui_SOURCES = \ $(lumigui_srcdir)/widgets/video-display-widget.hpp \ $(lumigui_srcdir)/widgets/timeline-widget.cpp \ $(lumigui_srcdir)/widgets/timeline-widget.hpp \ + $(lumigui_srcdir)/widgets/timeline/header-container.cpp \ + $(lumigui_srcdir)/widgets/timeline/header-container.hpp \ $(lumigui_srcdir)/widgets/timeline/track.cpp \ $(lumigui_srcdir)/widgets/timeline/track.hpp \ $(lumigui_srcdir)/widgets/timeline/video-track.cpp \ diff --git a/src/gui/lumiera_ui.rc b/src/gui/lumiera_ui.rc index f37b4c12b..b2d951ae1 100644 --- a/src/gui/lumiera_ui.rc +++ b/src/gui/lumiera_ui.rc @@ -5,10 +5,13 @@ #---------- Styles for Standard Widgets ----------# -style "medium_bold_entry" +style "medium_text" { font_name = "sans bold 10" - +} + +style "medium_bold_entry" = "medium_text" +{ fg[NORMAL] = { 0.70, 0.70, 0.70 } fg[ACTIVE] = { 0.70, 0.70, 0.70 } @@ -115,5 +118,17 @@ style "timeline_body" gtkmm__CustomObject_TimelineBody::track_background = "#7E838B" } +style "timeline_header_base" = "default_base" +{ + fg[NORMAL] = { 0.77, 0.77, 0.72 } + bg[NORMAL] = { 0.18, 0.19, 0.22 } + bg[ACTIVE] = { 0.20, 0.20, 0.20 } + bg[PRELIGHT] = { 0.20, 0.20, 0.20 } + bg[INSENSITIVE] = { 0.20, 0.20, 0.20 } + bg[SELECTED] = { 0.20, 0.20, 0.20 } +} + class "gtkmm__CustomObject_TimelineBody" style:highest "timeline_body" +widget "*TimelineHeaderBaseUnselected" style:highest "timeline_header_base" + diff --git a/src/gui/widgets/timeline-widget.cpp b/src/gui/widgets/timeline-widget.cpp index e448f62f2..d201dd47f 100644 --- a/src/gui/widgets/timeline-widget.cpp +++ b/src/gui/widgets/timeline-widget.cpp @@ -31,6 +31,7 @@ namespace gui { namespace widgets { const int TimelineWidget::TrackPadding = 1; +const int TimelineWidget::HeaderWidth = 100; TimelineWidget::TimelineWidget() : Table(2, 2), @@ -41,68 +42,94 @@ TimelineWidget::TimelineWidget() : verticalScroll(verticalAdjustment), ruler("ruler") { - rowHeaderLayout.set_size_request(100, 0); - body = new TimelineBody(this); - + g_assert(body != NULL); + headerContainer = new HeaderContainer(this); + g_assert(headerContainer != NULL); + verticalAdjustment.signal_value_changed().connect( sigc::mem_fun(this, &TimelineWidget::on_scroll) ); attach(*body, 1, 2, 1, 2, FILL|EXPAND, FILL|EXPAND); attach(ruler, 1, 2, 0, 1, FILL|EXPAND, SHRINK); - attach(rowHeaderLayout, 0, 1, 1, 2, SHRINK, FILL|EXPAND); + attach(*headerContainer, 0, 1, 1, 2, SHRINK, FILL|EXPAND); attach(horizontalScroll, 1, 2, 2, 3, FILL|EXPAND, SHRINK); attach(verticalScroll, 2, 3, 1, 2, SHRINK, FILL|EXPAND); tracks.push_back(&video1); tracks.push_back(&video2); - - layout_tracks(); + + update_tracks(); } TimelineWidget::~TimelineWidget() { + g_assert(body != NULL); delete body; + g_assert(headerContainer != NULL); + delete headerContainer; } void TimelineWidget::on_scroll() { - move_headers(); + } - + void -TimelineWidget::layout_tracks() +TimelineWidget::on_size_allocate(Allocation& allocation) { + Widget::on_size_allocate(allocation); + + update_scroll(); + } + +void +TimelineWidget::update_tracks() + { + g_assert(headerContainer != NULL); + headerContainer->update_headers(); + + // Recalculate the total height of the timeline scrolled area + totalHeight = 0; vector::iterator i; for(i = tracks.begin(); i != tracks.end(); i++) - { - timeline::Track *track = *i; - g_assert(track != NULL); - rowHeaderLayout.put(track->get_header_widget(), 0, 0); - } - - move_headers(); + { + timeline::Track *track = *i; + g_assert(track != NULL); + totalHeight += track->get_height() + TrackPadding; + } + } + +void +TimelineWidget::update_scroll() + { + g_assert(body != NULL); + const Allocation body_allocation = body->get_allocation(); + + // Calculate the length that can be scrolled: + // the total height of all the tracks minus one screenful + int y_scroll_length = totalHeight - body_allocation.get_height(); + if(y_scroll_length < 0) y_scroll_length = 0; + + // If by resizing we're now over-scrolled, scroll back to + // maximum distance + if((int)verticalAdjustment.get_value() > y_scroll_length) + verticalAdjustment.set_value(y_scroll_length); + + verticalAdjustment.set_upper(y_scroll_length); + + // Hide the scrollbar if no scrolling is possible + if(y_scroll_length == 0 && verticalScroll.is_visible()) + verticalScroll.hide(); + else if(y_scroll_length != 0 && !verticalScroll.is_visible()) + verticalScroll.show(); } -void -TimelineWidget::move_headers() +int +TimelineWidget::get_y_scroll_offset() const { - int offset = 0; - const int y_scroll_offset = (int)verticalAdjustment.get_value(); - - vector::iterator i; - for(i = tracks.begin(); i != tracks.end(); i++) - { - timeline::Track *track = *i; - g_assert(track != NULL); - - const int height = track->get_track_height(); - rowHeaderLayout.move(track->get_header_widget(), 0, offset - y_scroll_offset); - offset += height + TrackPadding; - } - totalHeight = offset; - verticalAdjustment.set_upper(totalHeight); + return (int)verticalAdjustment.get_value(); } } // namespace widgets diff --git a/src/gui/widgets/timeline-widget.hpp b/src/gui/widgets/timeline-widget.hpp index fb87f321b..502b3c535 100644 --- a/src/gui/widgets/timeline-widget.hpp +++ b/src/gui/widgets/timeline-widget.hpp @@ -26,6 +26,7 @@ #ifndef TIMELINE_WIDGET_HPP #define TIMELINE_WIDGET_HPP +#include "timeline/header-container.hpp" #include "timeline/timeline-body.hpp" #include "timeline/track.hpp" #include "timeline/video-track.hpp" @@ -47,12 +48,17 @@ class TimelineWidget : public Gtk::Table /* ===== Events ===== */ protected: void on_scroll(); + + void on_size_allocate(Gtk::Allocation& allocation); /* ===== Internals ===== */ protected: - void layout_tracks(); - - void move_headers(); + + void update_tracks(); + + void update_scroll(); + + int get_y_scroll_offset() const; protected: int totalHeight; @@ -61,10 +67,9 @@ class TimelineWidget : public Gtk::Table timeline::VideoTrack video2; std::vector tracks; - Gtk::Layout rowHeaderLayout; - Gtk::Label ruler; - timeline::TimelineBody *body; + timeline::HeaderContainer *headerContainer; + Gtk::Label ruler; Gtk::Adjustment horizontalAdjustment, verticalAdjustment; Gtk::HScrollbar horizontalScroll; @@ -73,8 +78,10 @@ class TimelineWidget : public Gtk::Table /* ===== Constants ===== */ protected: static const int TrackPadding; + static const int HeaderWidth; friend class timeline::TimelineBody; + friend class timeline::HeaderContainer; }; } // namespace widgets diff --git a/src/gui/widgets/timeline/header-container.cpp b/src/gui/widgets/timeline/header-container.cpp new file mode 100644 index 000000000..630f4be90 --- /dev/null +++ b/src/gui/widgets/timeline/header-container.cpp @@ -0,0 +1,193 @@ +/* + header-container.cpp - Implementation of the header container widget + + Copyright (C) Lumiera.org + 2008, Joel Holdsworth + + 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 "header-container.hpp" +#include "track.hpp" +#include "../timeline-widget.hpp" + +using namespace Gtk; +using namespace std; + +namespace lumiera { +namespace gui { +namespace widgets { +namespace timeline { + +HeaderContainer::HeaderContainer(lumiera::gui::widgets::TimelineWidget *timeline_widget) : + timelineWidget(timeline_widget) + { + set_flags(Gtk::NO_WINDOW); + set_redraw_on_allocate(false); + + timelineWidget->verticalAdjustment.signal_value_changed().connect( + sigc::mem_fun(this, &HeaderContainer::on_scroll) ); + } + +void +HeaderContainer::update_headers() + { + g_assert(timelineWidget != NULL); + + vector &tracks = timelineWidget->tracks; + vector::iterator i; + for(i = tracks.begin(); i != tracks.end(); i++) + { + timeline::Track *track = *i; + g_assert(track != NULL); + + Widget &header = track->get_header_widget(); + header.set_parent(*this); + header.show(); + } + + layout_headers(); + } + +void +HeaderContainer::on_realize() + { + set_flags(Gtk::NO_WINDOW); + + ensure_style(); + + // Call base class: + Gtk::Widget::on_realize(); + + // Create the GdkWindow: + GdkWindowAttr attributes; + memset(&attributes, 0, sizeof(attributes)); + + Allocation allocation = get_allocation(); + + // Set initial position and size of the Gdk::Window: + attributes.x = allocation.get_x(); + attributes.y = allocation.get_y(); + attributes.width = allocation.get_width(); + attributes.height = allocation.get_height(); + + attributes.event_mask = get_events () | Gdk::EXPOSURE_MASK; + attributes.window_type = GDK_WINDOW_CHILD; + attributes.wclass = GDK_INPUT_OUTPUT; + + gdkWindow = Gdk::Window::create(get_window() /* parent */, &attributes, + GDK_WA_X | GDK_WA_Y); + unset_flags(Gtk::NO_WINDOW); + set_window(gdkWindow); + + // Unset the background so as to make the colour match the parent window + unset_bg(STATE_NORMAL); + + // Make the widget receive expose events + gdkWindow->set_user_data(gobj()); + } + +void +HeaderContainer::on_unrealize() + { + gdkWindow.clear(); + + //Call base class: + Gtk::Widget::on_unrealize(); + } + +void +HeaderContainer::on_size_request (Requisition* requisition) + { + //Initialize the output parameter: + *requisition = Gtk::Requisition(); + + requisition->width = TimelineWidget::HeaderWidth; + requisition->height = 0; + } + +void +HeaderContainer::on_size_allocate (Allocation& allocation) + { + // Use the offered allocation for this container: + set_allocation(allocation); + + // Resize the widget's window + if(gdkWindow) + gdkWindow->resize(allocation.get_width(), allocation.get_height()); + + // Relayout the child widgets of the headers + layout_headers(); + } + +void +HeaderContainer::forall_vfunc(gboolean /* include_internals */, + GtkCallback callback, gpointer callback_data) + { + g_assert(timelineWidget != NULL); + + vector &tracks = timelineWidget->tracks; + vector::iterator i; + for(i = tracks.begin(); i != tracks.end(); i++) + { + timeline::Track *track = *i; + g_assert(track != NULL); + callback(track->get_header_widget().gobj(), + callback_data); + } + } + +void +HeaderContainer::on_scroll() + { + layout_headers(); + } + +void +HeaderContainer::layout_headers() + { + g_assert(timelineWidget != NULL); + + int offset = 0; + const int y_scroll_offset = timelineWidget->get_y_scroll_offset(); + + const Allocation container_allocation = get_allocation(); + + vector &tracks = timelineWidget->tracks; + vector::iterator i; + for(i = tracks.begin(); i != tracks.end(); i++) + { + timeline::Track *track = *i; + g_assert(track != NULL); + Widget &header = track->get_header_widget(); + + const int height = 100;//header->get_track_height(); + + Gtk::Allocation header_allocation; + header_allocation.set_x (0); + header_allocation.set_y (offset - y_scroll_offset); + header_allocation.set_width (container_allocation.get_width ()); + header_allocation.set_height (height); + header.size_allocate(header_allocation); + + offset += height + TimelineWidget::TrackPadding; + } + } + +} // namespace timeline +} // namespace widgets +} // namespace gui +} // namespace lumiera diff --git a/src/gui/widgets/timeline/header-container.hpp b/src/gui/widgets/timeline/header-container.hpp new file mode 100644 index 000000000..f82dc3dce --- /dev/null +++ b/src/gui/widgets/timeline/header-container.hpp @@ -0,0 +1,76 @@ +/* + header-container.hpp - Declaration of the header container widget + + Copyright (C) Lumiera.org + 2008, Joel Holdsworth + + 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. + +*/ +/** @file header-container.hpp + ** This file contains the definition of the header container + ** widget + */ + +#ifndef HEADER_CONTAINER_HPP +#define HEADER_CONTAINER_HPP + +#include +#include + +namespace lumiera { +namespace gui { +namespace widgets { + +class TimelineWidget; + +namespace timeline { + +class HeaderContainer : public Gtk::Container + { + public: + HeaderContainer(lumiera::gui::widgets::TimelineWidget *timeline_widget); + + void update_headers(); + + private: + void on_realize(); + void on_unrealize(); + + void on_size_allocate (Gtk::Allocation& allocation); + void on_size_request (Gtk::Requisition* requisition); + + void forall_vfunc(gboolean include_internals, GtkCallback callback, + gpointer callback_data); + + void on_scroll(); + + /* ===== Internals ===== */ + private: + void layout_headers(); + + private: + lumiera::gui::widgets::TimelineWidget *timelineWidget; + + Glib::RefPtr gdkWindow; + }; + +} // namespace timeline +} // namespace widgets +} // namespace gui +} // namespace lumiera + +#endif // HEADER_CONTAINER_HPP + diff --git a/src/gui/widgets/timeline/timeline-body.cpp b/src/gui/widgets/timeline/timeline-body.cpp index e7c9e0b78..859abb0e8 100644 --- a/src/gui/widgets/timeline/timeline-body.cpp +++ b/src/gui/widgets/timeline/timeline-body.cpp @@ -91,7 +91,7 @@ TimelineBody::on_expose_event(GdkEventExpose* event) timeline::Track *track = *i; g_assert(track != NULL); - const int track_height = track->get_track_height(); + const int track_height = track->get_height(); // Draw the track background cairo->rectangle(0, 0, allocation.get_width(), track_height); @@ -112,23 +112,23 @@ TimelineBody::on_expose_event(GdkEventExpose* event) void TimelineBody::read_styles() -{ - GdkColor *colour; - - gtk_widget_style_get(Widget::gobj(), "track_background", &colour, NULL); - - // Did the color load successfully? - if(colour != NULL) - track_background = *colour; - else { - g_warning("track_background style value failed to load"); - track_background.red = 0x0000; - track_background.green = 0x0000; - track_background.blue = 0x0000; - track_background.pixel = 0x00000000; + GdkColor *colour; + + gtk_widget_style_get(Widget::gobj(), "track_background", &colour, NULL); + + // Did the color load successfully? + if(colour != NULL) + track_background = *colour; + else + { + g_warning("track_background style value failed to load"); + track_background.red = 0x0000; + track_background.green = 0x0000; + track_background.blue = 0x0000; + track_background.pixel = 0x00000000; + } } -} } // namespace timeline } // namespace widgets diff --git a/src/gui/widgets/timeline/timeline-body.hpp b/src/gui/widgets/timeline/timeline-body.hpp index c58323b1b..d3ba192ab 100644 --- a/src/gui/widgets/timeline/timeline-body.hpp +++ b/src/gui/widgets/timeline/timeline-body.hpp @@ -41,9 +41,6 @@ class TimelineBody : public Gtk::DrawingArea public: TimelineBody(lumiera::gui::widgets::TimelineWidget *timeline_widget); - protected: - lumiera::gui::widgets::TimelineWidget *timelineWidget; - /* ===== Events ===== */ protected: void on_scroll(); @@ -56,6 +53,8 @@ class TimelineBody : public Gtk::DrawingArea private: GdkColor track_background; + + lumiera::gui::widgets::TimelineWidget *timelineWidget; }; } // namespace timeline diff --git a/src/gui/widgets/timeline/track.cpp b/src/gui/widgets/timeline/track.cpp index 510dfc798..6b915949d 100644 --- a/src/gui/widgets/timeline/track.cpp +++ b/src/gui/widgets/timeline/track.cpp @@ -37,6 +37,12 @@ Track::get_title() { return "Hello"; } + +int +Track::get_height() + { + return get_header_widget().get_allocation().get_height(); + } void Track::draw_track(Cairo::RefPtr cairo) diff --git a/src/gui/widgets/timeline/track.hpp b/src/gui/widgets/timeline/track.hpp index 15254ea00..5f368ea18 100644 --- a/src/gui/widgets/timeline/track.hpp +++ b/src/gui/widgets/timeline/track.hpp @@ -42,12 +42,11 @@ class Track virtual Gtk::Widget& get_header_widget() = 0; - virtual int get_track_height() = 0; + virtual int get_height(); virtual void draw_track(Cairo::RefPtr cairo); protected: - }; diff --git a/src/gui/widgets/timeline/video-track.cpp b/src/gui/widgets/timeline/video-track.cpp index 6fd55fea5..b20992543 100644 --- a/src/gui/widgets/timeline/video-track.cpp +++ b/src/gui/widgets/timeline/video-track.cpp @@ -32,20 +32,25 @@ namespace timeline { VideoTrack::VideoTrack() : headerWidget("HeaderTest") { - + headerFrame.add(headerWidget); + headerFrame.set_shadow_type (Gtk::SHADOW_ETCHED_OUT); + headerFrame.set_name ("TimelineHeaderBaseUnselected"); } -Gtk::Widget& VideoTrack::get_header_widget() +Gtk::Widget& +VideoTrack::get_header_widget() { - return headerWidget; + return headerFrame; } -int VideoTrack::get_track_height() +/*int +VideoTrack::get_height() { return 100; - } + }*/ -void VideoTrack::draw_track(Cairo::RefPtr cairo) +void +VideoTrack::draw_track(Cairo::RefPtr cairo) { } @@ -54,3 +59,4 @@ void VideoTrack::draw_track(Cairo::RefPtr cairo) } // namespace widgets } // namespace gui } // namespace lumiera + diff --git a/src/gui/widgets/timeline/video-track.hpp b/src/gui/widgets/timeline/video-track.hpp index d73a03b6e..fad2f77af 100644 --- a/src/gui/widgets/timeline/video-track.hpp +++ b/src/gui/widgets/timeline/video-track.hpp @@ -40,12 +40,13 @@ class VideoTrack : public Track virtual Gtk::Widget& get_header_widget(); - virtual int get_track_height(); + //virtual int get_height(); virtual void draw_track(Cairo::RefPtr cairo); protected: Gtk::Label headerWidget; + Gtk::Frame headerFrame; }; } // namespace timeline diff --git a/src/gui/widgets/video-display-widget.cpp b/src/gui/widgets/video-display-widget.cpp index 920ea379c..2c7be8111 100644 --- a/src/gui/widgets/video-display-widget.cpp +++ b/src/gui/widgets/video-display-widget.cpp @@ -36,123 +36,123 @@ namespace widgets { VideoDisplayWidget::VideoDisplayWidget() : gdkWindow(NULL), displayer(NULL) -{ - set_flags(Gtk::NO_WINDOW); -} + { + set_flags(Gtk::NO_WINDOW); + } VideoDisplayWidget::~VideoDisplayWidget() -{ - if(displayer != NULL) - delete displayer; -} + { + if(displayer != NULL) + delete displayer; + } void VideoDisplayWidget::on_realize() -{ - set_flags(Gtk::NO_WINDOW); + { + set_flags(Gtk::NO_WINDOW); - //Call base class: - Gtk::Widget::on_realize(); + // Call base class: + Gtk::Widget::on_realize(); - //Create the GdkWindow: - GdkWindowAttr attributes; - memset(&attributes, 0, sizeof(attributes)); + // Create the GdkWindow: + GdkWindowAttr attributes; + memset(&attributes, 0, sizeof(attributes)); - Gtk::Allocation allocation = get_allocation(); + Gtk::Allocation allocation = get_allocation(); - //Set initial position and size of the Gdk::Window: - attributes.x = allocation.get_x(); - attributes.y = allocation.get_y(); - attributes.width = allocation.get_width(); - attributes.height = allocation.get_height(); + // Set initial position and size of the Gdk::Window: + attributes.x = allocation.get_x(); + attributes.y = allocation.get_y(); + attributes.width = allocation.get_width(); + attributes.height = allocation.get_height(); - attributes.event_mask = get_events () | Gdk::EXPOSURE_MASK; - attributes.window_type = GDK_WINDOW_CHILD; - attributes.wclass = GDK_INPUT_OUTPUT; + attributes.event_mask = get_events () | Gdk::EXPOSURE_MASK; + attributes.window_type = GDK_WINDOW_CHILD; + attributes.wclass = GDK_INPUT_OUTPUT; - gdkWindow = Gdk::Window::create(get_window() /* parent */, &attributes, - GDK_WA_X | GDK_WA_Y); - unset_flags(Gtk::NO_WINDOW); - set_window(gdkWindow); + gdkWindow = Gdk::Window::create(get_window() /* parent */, &attributes, + GDK_WA_X | GDK_WA_Y); + unset_flags(Gtk::NO_WINDOW); + set_window(gdkWindow); - //set colors - modify_bg(Gtk::STATE_NORMAL, Gdk::Color("black")); + // Set colors + modify_bg(Gtk::STATE_NORMAL, Gdk::Color("black")); - //make the widget receive expose events - gdkWindow->set_user_data(gobj()); + // Make the widget receive expose events + gdkWindow->set_user_data(gobj()); - if(displayer != NULL) - delete displayer; - displayer = createDisplayer(this, 320, 240); + if(displayer != NULL) + delete displayer; + displayer = createDisplayer(this, 320, 240); - add_events(Gdk::ALL_EVENTS_MASK); -} + add_events(Gdk::ALL_EVENTS_MASK); + } void VideoDisplayWidget::on_unrealize() -{ - gdkWindow.clear(); + { + gdkWindow.clear(); - //Call base class: - Gtk::Widget::on_unrealize(); -} + //Call base class: + Gtk::Widget::on_unrealize(); + } bool VideoDisplayWidget::on_button_press_event (GdkEventButton* event) -{ - unsigned char buffer[320 * 240 * 4]; + { + unsigned char buffer[320 * 240 * 4]; - for(int i = 0; i < 320*240*4; i++) - buffer[i] = rand(); + for(int i = 0; i < 320*240*4; i++) + buffer[i] = rand(); - displayer->put((void*)buffer); + displayer->put((void*)buffer); - return true; -} + return true; + } bool VideoDisplayWidget::on_expose_event(GdkEventExpose* event) -{ - // This is where we draw on the window - /*Glib::RefPtr window = get_window(); - if(window) { - Cairo::RefPtr cr = window->create_cairo_context(); - if(event) + // This is where we draw on the window + /*Glib::RefPtr window = get_window(); + if(window) { - // clip to the area that needs to be re-exposed so we don't draw any - // more than we need to. - cr->rectangle(event->area.x, event->area.y, - event->area.width, event->area.height); - cr->clip(); - } + Cairo::RefPtr cr = window->create_cairo_context(); + if(event) + { + // clip to the area that needs to be re-exposed so we don't draw any + // more than we need to. + cr->rectangle(event->area.x, event->area.y, + event->area.width, event->area.height); + cr->clip(); + } - // Paint the background - cr->set_source_rgb(0.0, 0.0, 0.0); - cr->paint(); - }*/ - return true; -} + // Paint the background + cr->set_source_rgb(0.0, 0.0, 0.0); + cr->paint(); + }*/ + return true; + } Displayer* VideoDisplayWidget::createDisplayer( Gtk::Widget *drawingArea, int width, int height ) -{ - Displayer *displayer = NULL; - - displayer = new XvDisplayer( drawingArea, width, height ); - if ( !displayer->usable() ) { - delete displayer; - displayer = NULL; - } + Displayer *displayer = NULL; - if ( displayer == NULL ) - { - displayer = new GdkDisplayer( drawingArea, width, height ); - } + displayer = new XvDisplayer( drawingArea, width, height ); + if ( !displayer->usable() ) + { + delete displayer; + displayer = NULL; + } - return displayer; -} + if ( displayer == NULL ) + { + displayer = new GdkDisplayer( drawingArea, width, height ); + } + + return displayer; + } } // namespace widgets } // namespace gui From 85730b889e38f4504cb4a57873715807a9273b4c Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Thu, 5 Jun 2008 23:57:04 +0100 Subject: [PATCH 052/110] Fixed to assertion failures, and move the frame ownership to HeaderContainer --- src/gui/widgets/timeline-widget.cpp | 23 ++++++----- src/gui/widgets/timeline-widget.hpp | 4 +- src/gui/widgets/timeline/header-container.cpp | 38 +++++++++---------- src/gui/widgets/timeline/header-container.hpp | 1 + src/gui/widgets/timeline/track.cpp | 4 +- src/gui/widgets/timeline/track.hpp | 2 +- src/gui/widgets/timeline/video-track.cpp | 10 ++--- src/gui/widgets/timeline/video-track.hpp | 2 +- 8 files changed, 40 insertions(+), 44 deletions(-) diff --git a/src/gui/widgets/timeline-widget.cpp b/src/gui/widgets/timeline-widget.cpp index d201dd47f..db8bcd614 100644 --- a/src/gui/widgets/timeline-widget.cpp +++ b/src/gui/widgets/timeline-widget.cpp @@ -42,17 +42,19 @@ TimelineWidget::TimelineWidget() : verticalScroll(verticalAdjustment), ruler("ruler") { - body = new TimelineBody(this); - g_assert(body != NULL); - headerContainer = new HeaderContainer(this); - g_assert(headerContainer != NULL); + TimelineBody *body_ptr = new TimelineBody(this); + body = Glib::RefPtr(body_ptr); + g_assert(body); + HeaderContainer *header_container_ptr = new HeaderContainer(this); + headerContainer = Glib::RefPtr(header_container_ptr); + g_assert(headerContainer); verticalAdjustment.signal_value_changed().connect( sigc::mem_fun(this, &TimelineWidget::on_scroll) ); - attach(*body, 1, 2, 1, 2, FILL|EXPAND, FILL|EXPAND); + attach(*body_ptr, 1, 2, 1, 2, FILL|EXPAND, FILL|EXPAND); attach(ruler, 1, 2, 0, 1, FILL|EXPAND, SHRINK); - attach(*headerContainer, 0, 1, 1, 2, SHRINK, FILL|EXPAND); + attach(*header_container_ptr, 0, 1, 1, 2, SHRINK, FILL|EXPAND); attach(horizontalScroll, 1, 2, 2, 3, FILL|EXPAND, SHRINK); attach(verticalScroll, 2, 3, 1, 2, SHRINK, FILL|EXPAND); @@ -64,10 +66,7 @@ TimelineWidget::TimelineWidget() : TimelineWidget::~TimelineWidget() { - g_assert(body != NULL); - delete body; - g_assert(headerContainer != NULL); - delete headerContainer; + } void @@ -87,7 +86,7 @@ TimelineWidget::on_size_allocate(Allocation& allocation) void TimelineWidget::update_tracks() { - g_assert(headerContainer != NULL); + g_assert(headerContainer); headerContainer->update_headers(); // Recalculate the total height of the timeline scrolled area @@ -104,7 +103,7 @@ TimelineWidget::update_tracks() void TimelineWidget::update_scroll() { - g_assert(body != NULL); + g_assert(body); const Allocation body_allocation = body->get_allocation(); // Calculate the length that can be scrolled: diff --git a/src/gui/widgets/timeline-widget.hpp b/src/gui/widgets/timeline-widget.hpp index 502b3c535..cd752060a 100644 --- a/src/gui/widgets/timeline-widget.hpp +++ b/src/gui/widgets/timeline-widget.hpp @@ -67,8 +67,8 @@ class TimelineWidget : public Gtk::Table timeline::VideoTrack video2; std::vector tracks; - timeline::TimelineBody *body; - timeline::HeaderContainer *headerContainer; + Glib::RefPtr body; + Glib::RefPtr headerContainer; Gtk::Label ruler; Gtk::Adjustment horizontalAdjustment, verticalAdjustment; diff --git a/src/gui/widgets/timeline/header-container.cpp b/src/gui/widgets/timeline/header-container.cpp index 630f4be90..40c92698b 100644 --- a/src/gui/widgets/timeline/header-container.cpp +++ b/src/gui/widgets/timeline/header-container.cpp @@ -53,10 +53,15 @@ HeaderContainer::update_headers() { timeline::Track *track = *i; g_assert(track != NULL); + + Glib::RefPtr headerFrame(new Gtk::Frame()); + headerFrame->add(track->get_header_widget()); + headerFrame->set_shadow_type (Gtk::SHADOW_ETCHED_OUT); + headerFrame->set_name ("TimelineHeaderBaseUnselected"); + headerFrame->set_parent(*this); + headerFrame->show(); - Widget &header = track->get_header_widget(); - header.set_parent(*this); - header.show(); + rootHeaders.push_back(headerFrame); } layout_headers(); @@ -136,17 +141,13 @@ HeaderContainer::on_size_allocate (Allocation& allocation) void HeaderContainer::forall_vfunc(gboolean /* include_internals */, GtkCallback callback, gpointer callback_data) - { - g_assert(timelineWidget != NULL); - - vector &tracks = timelineWidget->tracks; - vector::iterator i; - for(i = tracks.begin(); i != tracks.end(); i++) + { + vector< Glib::RefPtr >::iterator i; + for(i = rootHeaders.begin(); i != rootHeaders.end(); i++) { - timeline::Track *track = *i; - g_assert(track != NULL); - callback(track->get_header_widget().gobj(), - callback_data); + Glib::RefPtr header = *i; + g_assert(header); + callback(header->gobj(), callback_data); } } @@ -166,13 +167,10 @@ HeaderContainer::layout_headers() const Allocation container_allocation = get_allocation(); - vector &tracks = timelineWidget->tracks; - vector::iterator i; - for(i = tracks.begin(); i != tracks.end(); i++) + vector >::iterator i; + for(i = rootHeaders.begin(); i != rootHeaders.end(); i++) { - timeline::Track *track = *i; - g_assert(track != NULL); - Widget &header = track->get_header_widget(); + Glib::RefPtr header = *i; const int height = 100;//header->get_track_height(); @@ -181,7 +179,7 @@ HeaderContainer::layout_headers() header_allocation.set_y (offset - y_scroll_offset); header_allocation.set_width (container_allocation.get_width ()); header_allocation.set_height (height); - header.size_allocate(header_allocation); + header->size_allocate(header_allocation); offset += height + TimelineWidget::TrackPadding; } diff --git a/src/gui/widgets/timeline/header-container.hpp b/src/gui/widgets/timeline/header-container.hpp index f82dc3dce..ed8fb82e8 100644 --- a/src/gui/widgets/timeline/header-container.hpp +++ b/src/gui/widgets/timeline/header-container.hpp @@ -63,6 +63,7 @@ class HeaderContainer : public Gtk::Container private: lumiera::gui::widgets::TimelineWidget *timelineWidget; + std::vector< Glib::RefPtr > rootHeaders; Glib::RefPtr gdkWindow; }; diff --git a/src/gui/widgets/timeline/track.cpp b/src/gui/widgets/timeline/track.cpp index 6b915949d..3ae90ff41 100644 --- a/src/gui/widgets/timeline/track.cpp +++ b/src/gui/widgets/timeline/track.cpp @@ -38,11 +38,11 @@ Track::get_title() return "Hello"; } -int +/*int Track::get_height() { return get_header_widget().get_allocation().get_height(); - } + }*/ void Track::draw_track(Cairo::RefPtr cairo) diff --git a/src/gui/widgets/timeline/track.hpp b/src/gui/widgets/timeline/track.hpp index 5f368ea18..7c338d7bb 100644 --- a/src/gui/widgets/timeline/track.hpp +++ b/src/gui/widgets/timeline/track.hpp @@ -42,7 +42,7 @@ class Track virtual Gtk::Widget& get_header_widget() = 0; - virtual int get_height(); + virtual int get_height() = 0; virtual void draw_track(Cairo::RefPtr cairo); diff --git a/src/gui/widgets/timeline/video-track.cpp b/src/gui/widgets/timeline/video-track.cpp index b20992543..4242f0e3f 100644 --- a/src/gui/widgets/timeline/video-track.cpp +++ b/src/gui/widgets/timeline/video-track.cpp @@ -32,22 +32,20 @@ namespace timeline { VideoTrack::VideoTrack() : headerWidget("HeaderTest") { - headerFrame.add(headerWidget); - headerFrame.set_shadow_type (Gtk::SHADOW_ETCHED_OUT); - headerFrame.set_name ("TimelineHeaderBaseUnselected"); + } Gtk::Widget& VideoTrack::get_header_widget() { - return headerFrame; + return headerWidget; } -/*int +int VideoTrack::get_height() { return 100; - }*/ + } void VideoTrack::draw_track(Cairo::RefPtr cairo) diff --git a/src/gui/widgets/timeline/video-track.hpp b/src/gui/widgets/timeline/video-track.hpp index fad2f77af..d72b4b1c9 100644 --- a/src/gui/widgets/timeline/video-track.hpp +++ b/src/gui/widgets/timeline/video-track.hpp @@ -40,7 +40,7 @@ class VideoTrack : public Track virtual Gtk::Widget& get_header_widget(); - //virtual int get_height(); + virtual int get_height(); virtual void draw_track(Cairo::RefPtr cairo); From 3952e27a8fbd4e083854136c5b5c5dc5fa5948c6 Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Fri, 6 Jun 2008 00:30:31 +0100 Subject: [PATCH 053/110] Removed RefPtrs to make code more elegant --- src/gui/widgets/timeline-widget.cpp | 23 ++++++++++++----------- src/gui/widgets/timeline-widget.hpp | 4 ++-- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/gui/widgets/timeline-widget.cpp b/src/gui/widgets/timeline-widget.cpp index db8bcd614..5b3e73faa 100644 --- a/src/gui/widgets/timeline-widget.cpp +++ b/src/gui/widgets/timeline-widget.cpp @@ -42,19 +42,17 @@ TimelineWidget::TimelineWidget() : verticalScroll(verticalAdjustment), ruler("ruler") { - TimelineBody *body_ptr = new TimelineBody(this); - body = Glib::RefPtr(body_ptr); - g_assert(body); - HeaderContainer *header_container_ptr = new HeaderContainer(this); - headerContainer = Glib::RefPtr(header_container_ptr); - g_assert(headerContainer); + body = new TimelineBody(this); + g_assert(body != NULL); + headerContainer = new HeaderContainer(this); + g_assert(headerContainer != NULL); verticalAdjustment.signal_value_changed().connect( sigc::mem_fun(this, &TimelineWidget::on_scroll) ); - attach(*body_ptr, 1, 2, 1, 2, FILL|EXPAND, FILL|EXPAND); + attach(*body, 1, 2, 1, 2, FILL|EXPAND, FILL|EXPAND); attach(ruler, 1, 2, 0, 1, FILL|EXPAND, SHRINK); - attach(*header_container_ptr, 0, 1, 1, 2, SHRINK, FILL|EXPAND); + attach(*headerContainer, 0, 1, 1, 2, SHRINK, FILL|EXPAND); attach(horizontalScroll, 1, 2, 2, 3, FILL|EXPAND, SHRINK); attach(verticalScroll, 2, 3, 1, 2, SHRINK, FILL|EXPAND); @@ -66,7 +64,10 @@ TimelineWidget::TimelineWidget() : TimelineWidget::~TimelineWidget() { - + g_assert(body != NULL); + body->unreference(); + g_assert(headerContainer != NULL); + headerContainer->unreference(); } void @@ -86,7 +87,7 @@ TimelineWidget::on_size_allocate(Allocation& allocation) void TimelineWidget::update_tracks() { - g_assert(headerContainer); + g_assert(headerContainer != NULL); headerContainer->update_headers(); // Recalculate the total height of the timeline scrolled area @@ -103,7 +104,7 @@ TimelineWidget::update_tracks() void TimelineWidget::update_scroll() { - g_assert(body); + g_assert(body != NULL); const Allocation body_allocation = body->get_allocation(); // Calculate the length that can be scrolled: diff --git a/src/gui/widgets/timeline-widget.hpp b/src/gui/widgets/timeline-widget.hpp index cd752060a..502b3c535 100644 --- a/src/gui/widgets/timeline-widget.hpp +++ b/src/gui/widgets/timeline-widget.hpp @@ -67,8 +67,8 @@ class TimelineWidget : public Gtk::Table timeline::VideoTrack video2; std::vector tracks; - Glib::RefPtr body; - Glib::RefPtr headerContainer; + timeline::TimelineBody *body; + timeline::HeaderContainer *headerContainer; Gtk::Label ruler; Gtk::Adjustment horizontalAdjustment, verticalAdjustment; From 98df76e919ec0b712e602726e587f0d0497013e3 Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Sat, 7 Jun 2008 12:09:22 +0100 Subject: [PATCH 054/110] Added some documentation, and made a minor code correction in layout_headers --- src/gui/widgets/timeline-widget.cpp | 4 +- src/gui/widgets/timeline/header-container.cpp | 38 ++++++++----- src/gui/widgets/timeline/header-container.hpp | 57 ++++++++++++++++++- 3 files changed, 81 insertions(+), 18 deletions(-) diff --git a/src/gui/widgets/timeline-widget.cpp b/src/gui/widgets/timeline-widget.cpp index 5b3e73faa..799f1c736 100644 --- a/src/gui/widgets/timeline-widget.cpp +++ b/src/gui/widgets/timeline-widget.cpp @@ -107,7 +107,9 @@ TimelineWidget::update_scroll() g_assert(body != NULL); const Allocation body_allocation = body->get_allocation(); - // Calculate the length that can be scrolled: + //----- Vertical Scroll -----// + + // Calculate the vertical length that can be scrolled: // the total height of all the tracks minus one screenful int y_scroll_length = totalHeight - body_allocation.get_height(); if(y_scroll_length < 0) y_scroll_length = 0; diff --git a/src/gui/widgets/timeline/header-container.cpp b/src/gui/widgets/timeline/header-container.cpp index 40c92698b..a33562841 100644 --- a/src/gui/widgets/timeline/header-container.cpp +++ b/src/gui/widgets/timeline/header-container.cpp @@ -35,9 +35,11 @@ namespace timeline { HeaderContainer::HeaderContainer(lumiera::gui::widgets::TimelineWidget *timeline_widget) : timelineWidget(timeline_widget) { - set_flags(Gtk::NO_WINDOW); + set_flags(Gtk::NO_WINDOW); // This widget will not have a window at first set_redraw_on_allocate(false); + // Connect to the timeline widget's vertical scroll event, + // so that we get notified when the view shifts timelineWidget->verticalAdjustment.signal_value_changed().connect( sigc::mem_fun(this, &HeaderContainer::on_scroll) ); } @@ -47,8 +49,8 @@ HeaderContainer::update_headers() { g_assert(timelineWidget != NULL); - vector &tracks = timelineWidget->tracks; - vector::iterator i; + vector< Track* > &tracks = timelineWidget->tracks; + vector< Track* >::iterator i; for(i = tracks.begin(); i != tracks.end(); i++) { timeline::Track *track = *i; @@ -61,7 +63,8 @@ HeaderContainer::update_headers() headerFrame->set_parent(*this); headerFrame->show(); - rootHeaders.push_back(headerFrame); + const RootHeader header = { headerFrame, track }; + rootHeaders.push_back(header); } layout_headers(); @@ -93,7 +96,7 @@ HeaderContainer::on_realize() attributes.window_type = GDK_WINDOW_CHILD; attributes.wclass = GDK_INPUT_OUTPUT; - gdkWindow = Gdk::Window::create(get_window() /* parent */, &attributes, + gdkWindow = Gdk::Window::create(get_window(), &attributes, GDK_WA_X | GDK_WA_Y); unset_flags(Gtk::NO_WINDOW); set_window(gdkWindow); @@ -108,16 +111,17 @@ HeaderContainer::on_realize() void HeaderContainer::on_unrealize() { + // Unreference any window we may have created gdkWindow.clear(); - //Call base class: + // Call base class: Gtk::Widget::on_unrealize(); } void HeaderContainer::on_size_request (Requisition* requisition) { - //Initialize the output parameter: + // Initialize the output parameter: *requisition = Gtk::Requisition(); requisition->width = TimelineWidget::HeaderWidth; @@ -142,18 +146,20 @@ void HeaderContainer::forall_vfunc(gboolean /* include_internals */, GtkCallback callback, gpointer callback_data) { - vector< Glib::RefPtr >::iterator i; + vector< RootHeader >::iterator i; for(i = rootHeaders.begin(); i != rootHeaders.end(); i++) { - Glib::RefPtr header = *i; - g_assert(header); - callback(header->gobj(), callback_data); + RootHeader header = *i; + g_assert(header.widget); + callback(header.widget->gobj(), callback_data); } } void HeaderContainer::on_scroll() { + // If the scroll has changed, we will have to shift all the + // header widgets layout_headers(); } @@ -167,19 +173,21 @@ HeaderContainer::layout_headers() const Allocation container_allocation = get_allocation(); - vector >::iterator i; + vector< RootHeader >::iterator i; for(i = rootHeaders.begin(); i != rootHeaders.end(); i++) { - Glib::RefPtr header = *i; + RootHeader header = *i; + g_assert(header.widget); + g_assert(header.track != NULL); - const int height = 100;//header->get_track_height(); + const int height = header.track->get_height(); Gtk::Allocation header_allocation; header_allocation.set_x (0); header_allocation.set_y (offset - y_scroll_offset); header_allocation.set_width (container_allocation.get_width ()); header_allocation.set_height (height); - header->size_allocate(header_allocation); + header.widget->size_allocate(header_allocation); offset += height + TimelineWidget::TrackPadding; } diff --git a/src/gui/widgets/timeline/header-container.hpp b/src/gui/widgets/timeline/header-container.hpp index ed8fb82e8..69d13b953 100644 --- a/src/gui/widgets/timeline/header-container.hpp +++ b/src/gui/widgets/timeline/header-container.hpp @@ -38,13 +38,34 @@ class TimelineWidget; namespace timeline { +class Track; + +/** + * A helper class for the TimelineWidget. HeaderContainer is + * container widget for all the left-hand-side header widgets + * associated with timeline tracks. + */ class HeaderContainer : public Gtk::Container { public: + /** + * Constructor + * + * @param[in] timeline_widget A pointer to the owner timeline widget + */ HeaderContainer(lumiera::gui::widgets::TimelineWidget *timeline_widget); + /** + * Attaches the header all the header widgets of root + * tracks to this control. + * + * @note This must be called when the track list changes + * to synchronise the headers with the timeline body and + * the backend. + */ void update_headers(); + /* ===== Overrides ===== */ private: void on_realize(); void on_unrealize(); @@ -54,17 +75,49 @@ class HeaderContainer : public Gtk::Container void forall_vfunc(gboolean include_internals, GtkCallback callback, gpointer callback_data); - + + /* ===== Events ===== */ + private: void on_scroll(); /* ===== Internals ===== */ private: + + /** + * Moves all the header widgets to the correct position + * given scroll, stacking etc. + */ void layout_headers(); private: + + /** + * The owner TimelineWidget of which this class is a helper + */ lumiera::gui::widgets::TimelineWidget *timelineWidget; - std::vector< Glib::RefPtr > rootHeaders; + /** + * A structure to represent a header widget and it's + * associated track + */ + struct RootHeader + { + Glib::RefPtr widget; + Track *track; + }; + + /** + * Contains a list of the root currently present on + * the timeline view + */ + std::vector< RootHeader > rootHeaders; + + /** + * The widget's window object. + * + * @note This is needed for the sake of clipping when + * widgets are scrolled. + */ Glib::RefPtr gdkWindow; }; From 3b9d05a67d8570c7fb2135ee7dbd85ce0e05ec60 Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Sat, 7 Jun 2008 13:53:17 +0100 Subject: [PATCH 056/110] Made use of boost and nobug, added some documentation, and tidied code --- src/gui/dialogs/render.cpp | 6 +- src/gui/gtk-lumiera.cpp | 9 +- src/gui/gtk-lumiera.hpp | 3 + src/gui/output/displayer.cpp | 55 ++-- src/gui/output/displayer.hpp | 36 +- src/gui/output/gdkdisplayer.cpp | 64 ++-- src/gui/output/gdkdisplayer.hpp | 2 +- src/gui/output/xvdisplayer.cpp | 311 +++++++++--------- src/gui/widgets/timeline-widget.cpp | 20 +- src/gui/widgets/timeline-widget.hpp | 2 +- src/gui/widgets/timeline/header-container.cpp | 30 +- src/gui/widgets/timeline/timeline-body.cpp | 43 ++- src/gui/widgets/video-display-widget.cpp | 21 +- src/gui/workspace/actions.hpp | 2 +- src/gui/workspace/workspace-window.cpp | 32 +- 15 files changed, 338 insertions(+), 298 deletions(-) diff --git a/src/gui/dialogs/render.cpp b/src/gui/dialogs/render.cpp index 6fadd82fb..25dafdc88 100644 --- a/src/gui/dialogs/render.cpp +++ b/src/gui/dialogs/render.cpp @@ -41,7 +41,7 @@ namespace dialogs { videoFrame(_("Video")) { VBox *v_box = get_vbox(); - g_assert(v_box != NULL); + ASSERT(v_box != NULL); // The Output File Row outputFileHBox.pack_start(outputFileLabel, PACK_SHRINK); @@ -91,9 +91,9 @@ namespace dialogs { dialog.add_button(Gtk::Stock::SAVE, Gtk::RESPONSE_OK); int result = dialog.run(); - g_message("%d", result); + INFO(gui, "%d", result); if(result == RESPONSE_OK) - g_message("RESPONSE_OK"); + INFO(gui, "%d", "RESPONSE_OK"); } } // namespace dialogs diff --git a/src/gui/gtk-lumiera.cpp b/src/gui/gtk-lumiera.cpp index 7178c4170..69cfe0a4a 100644 --- a/src/gui/gtk-lumiera.cpp +++ b/src/gui/gtk-lumiera.cpp @@ -21,6 +21,7 @@ * *****************************************************/ #include +#include #ifdef ENABLE_NLS # include @@ -31,6 +32,8 @@ #include "workspace/workspace-window.hpp" #include "model/project.hpp" +NOBUG_CPP_DEFINE_FLAG(gui); + using namespace Gtk; using namespace lumiera::gui; using namespace lumiera::gui::workspace; @@ -38,8 +41,8 @@ using namespace lumiera::gui::model; GtkLumiera the_application; - int - main (int argc, char *argv[]) +int +main (int argc, char *argv[]) { return the_application.main(argc, argv); } @@ -52,6 +55,8 @@ namespace gui { int GtkLumiera::main(int argc, char *argv[]) { + NOBUG_INIT; + Main kit(argc, argv); Glib::set_application_name(AppTitle); diff --git a/src/gui/gtk-lumiera.hpp b/src/gui/gtk-lumiera.hpp index a3586e0d1..6cf7d3acc 100644 --- a/src/gui/gtk-lumiera.hpp +++ b/src/gui/gtk-lumiera.hpp @@ -29,6 +29,9 @@ #define GTK_LUMIERA_HPP #include +#include + +NOBUG_DECLARE_FLAG(gui); #ifdef ENABLE_NLS # include diff --git a/src/gui/output/displayer.cpp b/src/gui/output/displayer.cpp index 567bc8748..f2b036116 100644 --- a/src/gui/output/displayer.cpp +++ b/src/gui/output/displayer.cpp @@ -22,6 +22,7 @@ * *****************************************************/ +#include "../gtk-lumiera.hpp" #include "displayer.hpp" #include "xvdisplayer.hpp" #include "gdkdisplayer.hpp" @@ -32,43 +33,53 @@ namespace output { bool Displayer::usable() -{ - return false; -} + { + return false; + } DisplayerInput Displayer::format() -{ - return DISPLAY_NONE; -} + { + return DISPLAY_NONE; + } int Displayer::preferredWidth() -{ - return imageWidth; -} + { + return imageWidth; + } int Displayer::preferredHeight() -{ - return imageHeight; -} + { + return imageHeight; + } void Displayer::calculateVideoLayout( int widget_width, int widget_height, int image_width, int image_height, int &video_x, int &video_y, int &video_width, int &video_height ) -{ - double ratio_width = ( double ) widget_width / ( double ) image_width; - double ratio_height = ( double ) widget_height / ( double ) image_height; - double ratio_constant = ratio_height < ratio_width ? - ratio_height : ratio_width; - video_width = ( int ) ( image_width * ratio_constant + 0.5 ); - video_height = ( int ) ( image_height * ratio_constant + 0.5 ); - video_x = ( widget_width - video_width ) / 2; - video_y = ( widget_height - video_height ) / 2; -} + { + REQUIRE(widget_width >= 0); + REQUIRE(widget_height >= 0); + REQUIRE(image_width >= 0); + REQUIRE(image_height >= 0); + + double ratio_width = ( double ) widget_width / ( double ) image_width; + double ratio_height = ( double ) widget_height / ( double ) image_height; + double ratio_constant = ratio_height < ratio_width ? + ratio_height : ratio_width; + video_width = ( int ) ( image_width * ratio_constant + 0.5 ); + video_height = ( int ) ( image_height * ratio_constant + 0.5 ); + video_x = ( widget_width - video_width ) / 2; + video_y = ( widget_height - video_height ) / 2; + + ENSURE(video_x >= 0 && video_x < widget_width) + ENSURE(video_y >= 0 && video_y < widget_height) + ENSURE(video_width <= widget_width) + ENSURE(video_width <= widget_width) + } } // namespace output } // namespace gui diff --git a/src/gui/output/displayer.hpp b/src/gui/output/displayer.hpp index c117d5cb9..2441c0798 100644 --- a/src/gui/output/displayer.hpp +++ b/src/gui/output/displayer.hpp @@ -38,8 +38,7 @@ namespace output { #define MAX_HEIGHT 576 /** Supported Displayer formats - */ - + */ typedef enum { DISPLAY_NONE, DISPLAY_YUV, @@ -68,14 +67,14 @@ namespace output { If the widget being written to doesn't need a fixed size, then rewrite the two other put methods as required. - */ + */ class Displayer { public: /** Indicates if an object can be used to render images on the running system. - */ + */ virtual bool usable(); /** Indicates the format required by the abstract put method. @@ -83,22 +82,37 @@ namespace output { virtual DisplayerInput format(); /** Expected width of input to put. - */ + */ virtual int preferredWidth(); /** Expected height of input to put. - */ + */ virtual int preferredHeight(); - /** Put an image of a given width and height with the expected input - format (as indicated by the format method). - - \param image image of correct format and specified width/height - */ + /** + * Put an image of a given width and height with the expected input + * format (as indicated by the format method). + * + * @param image image of correct format and specified width/height + */ virtual void put( void * ) = 0; protected: + /** + * Calculates the coordinates for placing a video image inside a widget + * + * @param[in] widget_width The width of the display widget + * @param[in] widget_height The height of the display widget + * @param[in] image_width The width of the video image + * @param[in] image_height The height of the video image + * @param[out] video_x The x-coordinate of the top left corner of + * the scaled video image + * @param[out] video_y The y-coordinate of the top left corner of + * the scaled video image + * @param[out] video_width The width of the scale video image + * @param[out] video_height The height of the scale video image + */ static void calculateVideoLayout( int widget_width, int widget_height, int image_width, int image_height, diff --git a/src/gui/output/gdkdisplayer.cpp b/src/gui/output/gdkdisplayer.cpp index 262d28d5b..68ad6d545 100644 --- a/src/gui/output/gdkdisplayer.cpp +++ b/src/gui/output/gdkdisplayer.cpp @@ -22,11 +22,8 @@ * *****************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif +#include "../gtk-lumiera.hpp" -#include #include #include using std::cerr; @@ -40,36 +37,49 @@ namespace output { GdkDisplayer::GdkDisplayer( Gtk::Widget *drawing_area, int width, int height ) : drawingArea( drawing_area ) -{ - imageWidth = width, imageHeight = height; -} + { + REQUIRE(drawing_area != NULL); + REQUIRE(imageWidth > 0); + REQUIRE(imageHeight > 0); + + imageWidth = width, imageHeight = height; + } bool GdkDisplayer::usable() -{ - return true; -} + { + return true; + } void GdkDisplayer::put( void *image ) -{ - int video_x = 0, video_y = 0, video_width = 0, video_height = 0; - calculateVideoLayout( - drawingArea->get_width(), - drawingArea->get_height(), - preferredWidth(), preferredHeight(), - video_x, video_y, video_width, video_height ); + { + int video_x = 0, video_y = 0, video_width = 0, video_height = 0; + calculateVideoLayout( + drawingArea->get_width(), + drawingArea->get_height(), + preferredWidth(), preferredHeight(), + video_x, video_y, video_width, video_height ); - GdkWindow *window = drawingArea->get_window()->gobj(); - GdkGC *gc = gdk_gc_new( window ); - GdkPixbuf *pix = gdk_pixbuf_new_from_data( (const guchar*)image, GDK_COLORSPACE_RGB, FALSE, 8, - preferredWidth(), preferredHeight(), preferredWidth() * 3, NULL, NULL ); - GdkPixbuf *im = gdk_pixbuf_scale_simple( pix, video_width, video_height, GDK_INTERP_NEAREST ); - gdk_draw_pixbuf( window, gc, im, 0, 0, video_x, video_y, -1, -1, GDK_RGB_DITHER_NORMAL, 0, 0 ); - g_object_unref( im ); - g_object_unref( pix ); - g_object_unref( gc ); -} + GdkWindow *window = drawingArea->get_window()->gobj(); + ASSERT(window != NULL); + + GdkGC *gc = gdk_gc_new( window ); + ASSERT(gc != NULL); + + GdkPixbuf *pixbuf = gdk_pixbuf_new_from_data( (const guchar*)image, GDK_COLORSPACE_RGB, FALSE, 8, + preferredWidth(), preferredHeight(), preferredWidth() * 3, NULL, NULL ); + ASSERT(pixbuf != NULL); + + GdkPixbuf *scaled_image = gdk_pixbuf_scale_simple( pixbuf, video_width, video_height, GDK_INTERP_NEAREST ); + ASSERT(scaled_image != NULL); + + gdk_draw_pixbuf( window, gc, scaled_image, 0, 0, video_x, video_y, -1, -1, GDK_RGB_DITHER_NORMAL, 0, 0 ); + + g_object_unref( scaled_image ); + g_object_unref( pixbuf ); + g_object_unref( gc ); + } } // namespace output } // namespace gui diff --git a/src/gui/output/gdkdisplayer.hpp b/src/gui/output/gdkdisplayer.hpp index 7e72fa24e..40ef3b547 100644 --- a/src/gui/output/gdkdisplayer.hpp +++ b/src/gui/output/gdkdisplayer.hpp @@ -41,7 +41,7 @@ namespace lumiera { namespace gui { namespace output { - class GdkDisplayer : public Displayer +class GdkDisplayer : public Displayer { public: GdkDisplayer( Gtk::Widget *drawing_area, int width, int height ); diff --git a/src/gui/output/xvdisplayer.cpp b/src/gui/output/xvdisplayer.cpp index 428decc62..cf7eeb53f 100644 --- a/src/gui/output/xvdisplayer.cpp +++ b/src/gui/output/xvdisplayer.cpp @@ -22,15 +22,9 @@ * *****************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif +#include "../gtk-lumiera.hpp" -#include #include -#include -using std::cerr; -using std::endl; #include "xvdisplayer.hpp" @@ -42,191 +36,190 @@ XvDisplayer::XvDisplayer( Gtk::Widget *drawing_area, int width, int height ) : xvImage( NULL ), drawingArea( drawing_area ), gotPort( false ) -{ - cerr << ">> Trying XVideo at " << width << "x" << height << endl; - - imageWidth = width, imageHeight = height; - - shmInfo.shmaddr = NULL; - - Glib::RefPtr area_window = drawing_area->get_window(); - - window = gdk_x11_drawable_get_xid( area_window->gobj() ); - display = gdk_x11_drawable_get_xdisplay( area_window->gobj() ); - - unsigned int count; - XvAdaptorInfo *adaptorInfo; - - if ( XvQueryAdaptors( display, window, &count, &adaptorInfo ) == Success ) { + INFO(gui, "Trying XVideo at %d x %d", width, height); - cerr << ">>> XvQueryAdaptors count: " << count << endl; - for ( unsigned int n = 0; gotPort == false && n < count; ++n ) - { - // Diagnostics - cerr << ">>> Xv: " << adaptorInfo[ n ].name - << ": ports " << adaptorInfo[ n ].base_id - << " - " << adaptorInfo[ n ].base_id + - adaptorInfo[ n ].num_ports - 1 - << endl; + imageWidth = width, imageHeight = height; - for ( port = adaptorInfo[ n ].base_id; - port < adaptorInfo[ n ].base_id + adaptorInfo[ n ].num_ports; - port ++ ) + shmInfo.shmaddr = NULL; + + Glib::RefPtr area_window = drawing_area->get_window(); + + window = gdk_x11_drawable_get_xid( area_window->gobj() ); + display = gdk_x11_drawable_get_xdisplay( area_window->gobj() ); + + unsigned int count; + XvAdaptorInfo *adaptorInfo; + + if ( XvQueryAdaptors( display, window, &count, &adaptorInfo ) == Success ) { - if ( XvGrabPort( display, port, CurrentTime ) == Success ) - { - g_message("XvGrabPort == 0"); - int formats; - XvImageFormatValues *list; - list = XvListImageFormats( display, port, &formats ); - - cerr << ">>> formats supported: " << formats << endl; - - for ( int i = 0; i < formats; i ++ ) + INFO(gui, "XvQueryAdaptors count: %d", count); + for ( unsigned int n = 0; gotPort == false && n < count; ++n ) { - fprintf( stderr, ">>> 0x%x (%c%c%c%c) %s\n", - list[ i ].id, - ( list[ i ].id ) & 0xff, - ( list[ i ].id >> 8 ) & 0xff, - ( list[ i ].id >> 16 ) & 0xff, - ( list[ i ].id >> 24 ) & 0xff, - ( list[ i ].format == XvPacked ) ? "packed" : "planar" ); - if ( list[ i ].id == 0x32595559 && !gotPort ) - gotPort = true; + // Diagnostics + INFO(gui, "%s, %d, %d, %d", adaptorInfo[ n ].name, + adaptorInfo[ n ].base_id, adaptorInfo[ n ].num_ports - 1); + + for ( port = adaptorInfo[ n ].base_id; + port < adaptorInfo[ n ].base_id + adaptorInfo[ n ].num_ports; + port ++ ) + { + if ( XvGrabPort( display, port, CurrentTime ) == Success ) + { + int formats; + XvImageFormatValues *list; + + list = XvListImageFormats( display, port, &formats ); + + INFO(gui, "formats supported: %d", formats); + + for ( int i = 0; i < formats; i ++ ) + { + INFO(gui, "0x%x (%c%c%c%c) %s", + list[ i ].id, + ( list[ i ].id ) & 0xff, + ( list[ i ].id >> 8 ) & 0xff, + ( list[ i ].id >> 16 ) & 0xff, + ( list[ i ].id >> 24 ) & 0xff, + ( list[ i ].format == XvPacked ) ? "packed" : "planar" ); + if ( list[ i ].id == 0x32595559 && !gotPort ) + gotPort = true; + } + + if ( !gotPort ) + { + XvUngrabPort( display, port, CurrentTime ); + } + else + { + grabbedPort = port; + break; + } + } + } } - if ( !gotPort ) + if ( gotPort ) { - XvUngrabPort( display, port, CurrentTime ); + int num; + unsigned int unum; + XvEncodingInfo *enc; + + XvQueryEncodings( display, grabbedPort, &unum, &enc ); + for ( unsigned int index = 0; index < unum; index ++ ) + { + INFO(gui, "%d: %s, %ldx%ld rate = %d/%d", index, enc->name, + enc->width, enc->height, enc->rate.numerator, + enc->rate.denominator ); + } + + XvAttribute *xvattr = XvQueryPortAttributes( display, port, &num ); + for ( int k = 0; k < num; k++ ) + { + if ( xvattr[k].flags & XvSettable ) + { + if ( strcmp( xvattr[k].name, "XV_AUTOPAINT_COLORKEY") == 0 ) + { + Atom val_atom = XInternAtom( display, xvattr[k].name, False ); + if ( XvSetPortAttribute( display, port, val_atom, 1 ) != Success ) + ERROR(gui, "Couldn't set Xv attribute %s\n", xvattr[k].name); + } + else if ( strcmp( xvattr[k].name, "XV_COLORKEY") == 0 ) + { + Atom val_atom = XInternAtom( display, xvattr[k].name, False ); + if ( XvSetPortAttribute( display, port, val_atom, 0x010102 ) != Success ) + ERROR(gui, "Couldn't set Xv attribute %s\n", xvattr[k].name); + } + } + } } - else + + if ( gotPort ) { - grabbedPort = port; - break; - } - } - } - } + gc = XCreateGC( display, window, 0, &values ); - if ( gotPort ) - { - int num; - unsigned int unum; - XvEncodingInfo *enc; - - XvQueryEncodings( display, grabbedPort, &unum, &enc ); - for ( unsigned int index = 0; index < unum; index ++ ) - { - fprintf( stderr, ">>> %d: %s, %ldx%ld rate = %d/%d\n", index, enc->name, - enc->width, enc->height, enc->rate.numerator, - enc->rate.denominator ); - } - - XvAttribute *xvattr = XvQueryPortAttributes( display, port, &num ); - for ( int k = 0; k < num; k++ ) - { - if ( xvattr[k].flags & XvSettable ) - { - if ( strcmp( xvattr[k].name, "XV_AUTOPAINT_COLORKEY") == 0 ) - { - Atom val_atom = XInternAtom( display, xvattr[k].name, False ); - if ( XvSetPortAttribute( display, port, val_atom, 1 ) != Success ) - fprintf(stderr, "Couldn't set Xv attribute %s\n", xvattr[k].name); - } - else if ( strcmp( xvattr[k].name, "XV_COLORKEY") == 0 ) - { - Atom val_atom = XInternAtom( display, xvattr[k].name, False ); - if ( XvSetPortAttribute( display, port, val_atom, 0x010102 ) != Success ) - fprintf(stderr, "Couldn't set Xv attribute %s\n", xvattr[k].name); - } - } - } - } + xvImage = ( XvImage * ) XvShmCreateImage( display, port, 0x32595559, 0, width, height, &shmInfo ); - if ( gotPort ) - { - gc = XCreateGC( display, window, 0, &values ); - - xvImage = ( XvImage * ) XvShmCreateImage( display, port, 0x32595559, 0, width, height, &shmInfo ); - - shmInfo.shmid = shmget( IPC_PRIVATE, xvImage->data_size, IPC_CREAT | 0777 ); - if (shmInfo.shmid < 0) { - perror("shmget"); - gotPort = false; - } else { - shmInfo.shmaddr = ( char * ) shmat( shmInfo.shmid, 0, 0 ); - xvImage->data = shmInfo.shmaddr; - shmInfo.readOnly = 0; - if ( !XShmAttach( gdk_display, &shmInfo ) ) - { - gotPort = false; - } - XSync( display, false ); - shmctl( shmInfo.shmid, IPC_RMID, 0 ); + shmInfo.shmid = shmget( IPC_PRIVATE, xvImage->data_size, IPC_CREAT | 0777 ); + if (shmInfo.shmid < 0) { + perror("shmget"); + gotPort = false; + } + else + { + shmInfo.shmaddr = ( char * ) shmat( shmInfo.shmid, 0, 0 ); + xvImage->data = shmInfo.shmaddr; + shmInfo.readOnly = 0; + if ( !XShmAttach( gdk_display, &shmInfo ) ) + { + gotPort = false; + } + XSync( display, false ); + shmctl( shmInfo.shmid, IPC_RMID, 0 ); #if 0 - xvImage = ( XvImage * ) XvCreateImage( display, port, 0x32595559, pix, width , height ); + xvImage = ( XvImage * ) XvCreateImage( display, port, 0x32595559, pix, width , height ); #endif + } + } + } + else + { + gotPort = false; } - } } - else - { - gotPort = false; - } -} XvDisplayer::~XvDisplayer() -{ - cerr << ">> Destroying XV Displayer" << endl; - - if ( gotPort ) { - XvUngrabPort( display, grabbedPort, CurrentTime ); - } + ERROR(gui, "Destroying XV Displayer"); - //if ( xvImage != NULL ) - // XvStopVideo( display, port, window ); + if ( gotPort ) + { + XvUngrabPort( display, grabbedPort, CurrentTime ); + } - if ( shmInfo.shmaddr != NULL ) - { - XShmDetach( display, &shmInfo ); - shmctl( shmInfo.shmid, IPC_RMID, 0 ); - shmdt( shmInfo.shmaddr ); + //if ( xvImage != NULL ) + // XvStopVideo( display, port, window ); + + if ( shmInfo.shmaddr != NULL ) + { + XShmDetach( display, &shmInfo ); + shmctl( shmInfo.shmid, IPC_RMID, 0 ); + shmdt( shmInfo.shmaddr ); + } + + if ( xvImage != NULL ) + XFree( xvImage ); } - - if ( xvImage != NULL ) - XFree( xvImage ); -} bool XvDisplayer::usable() -{ - return gotPort; -} + { + return gotPort; + } void XvDisplayer::put( void *image ) -{ - g_assert(drawingArea != NULL); - - if(xvImage != NULL) { - int video_x = 0, video_y = 0, video_width = 0, video_height = 0; - calculateVideoLayout( - drawingArea->get_width(), - drawingArea->get_height(), - preferredWidth(), preferredHeight(), - video_x, video_y, video_width, video_height ); + REQUIRE(image != NULL); + ASSERT(drawingArea != NULL); + + if(xvImage != NULL) + { + int video_x = 0, video_y = 0, video_width = 0, video_height = 0; + calculateVideoLayout( + drawingArea->get_width(), + drawingArea->get_height(), + preferredWidth(), preferredHeight(), + video_x, video_y, video_width, video_height ); - memcpy( xvImage->data, image, xvImage->data_size ); + memcpy( xvImage->data, image, xvImage->data_size ); - XvShmPutImage( display, port, window, gc, xvImage, - 0, 0, preferredWidth(), preferredHeight(), - video_x, video_y, video_width, video_height, false ); + XvShmPutImage( display, port, window, gc, xvImage, + 0, 0, preferredWidth(), preferredHeight(), + video_x, video_y, video_width, video_height, false ); + } } -} } // namespace output } // namespace gui diff --git a/src/gui/widgets/timeline-widget.cpp b/src/gui/widgets/timeline-widget.cpp index 799f1c736..240cb09fb 100644 --- a/src/gui/widgets/timeline-widget.cpp +++ b/src/gui/widgets/timeline-widget.cpp @@ -22,6 +22,8 @@ #include "timeline-widget.hpp" +#include + using namespace Gtk; using namespace std; using namespace lumiera::gui::widgets::timeline; @@ -43,9 +45,9 @@ TimelineWidget::TimelineWidget() : ruler("ruler") { body = new TimelineBody(this); - g_assert(body != NULL); + ASSERT(body != NULL); headerContainer = new HeaderContainer(this); - g_assert(headerContainer != NULL); + ASSERT(headerContainer != NULL); verticalAdjustment.signal_value_changed().connect( sigc::mem_fun(this, &TimelineWidget::on_scroll) ); @@ -64,9 +66,9 @@ TimelineWidget::TimelineWidget() : TimelineWidget::~TimelineWidget() { - g_assert(body != NULL); + ASSERT(body != NULL); body->unreference(); - g_assert(headerContainer != NULL); + ASSERT(headerContainer != NULL); headerContainer->unreference(); } @@ -87,16 +89,14 @@ TimelineWidget::on_size_allocate(Allocation& allocation) void TimelineWidget::update_tracks() { - g_assert(headerContainer != NULL); + ASSERT(headerContainer != NULL); headerContainer->update_headers(); // Recalculate the total height of the timeline scrolled area totalHeight = 0; - vector::iterator i; - for(i = tracks.begin(); i != tracks.end(); i++) + BOOST_FOREACH( Track* track, tracks ) { - timeline::Track *track = *i; - g_assert(track != NULL); + ASSERT(track != NULL); totalHeight += track->get_height() + TrackPadding; } } @@ -104,7 +104,7 @@ TimelineWidget::update_tracks() void TimelineWidget::update_scroll() { - g_assert(body != NULL); + ASSERT(body != NULL); const Allocation body_allocation = body->get_allocation(); //----- Vertical Scroll -----// diff --git a/src/gui/widgets/timeline-widget.hpp b/src/gui/widgets/timeline-widget.hpp index 502b3c535..a53ef6368 100644 --- a/src/gui/widgets/timeline-widget.hpp +++ b/src/gui/widgets/timeline-widget.hpp @@ -26,12 +26,12 @@ #ifndef TIMELINE_WIDGET_HPP #define TIMELINE_WIDGET_HPP +#include "../gtk-lumiera.hpp" #include "timeline/header-container.hpp" #include "timeline/timeline-body.hpp" #include "timeline/track.hpp" #include "timeline/video-track.hpp" -#include #include namespace lumiera { diff --git a/src/gui/widgets/timeline/header-container.cpp b/src/gui/widgets/timeline/header-container.cpp index a33562841..a52393860 100644 --- a/src/gui/widgets/timeline/header-container.cpp +++ b/src/gui/widgets/timeline/header-container.cpp @@ -20,6 +20,8 @@ * *****************************************************/ +#include + #include "header-container.hpp" #include "track.hpp" #include "../timeline-widget.hpp" @@ -35,6 +37,8 @@ namespace timeline { HeaderContainer::HeaderContainer(lumiera::gui::widgets::TimelineWidget *timeline_widget) : timelineWidget(timeline_widget) { + REQUIRE(timeline_widget != NULL); + set_flags(Gtk::NO_WINDOW); // This widget will not have a window at first set_redraw_on_allocate(false); @@ -47,14 +51,11 @@ HeaderContainer::HeaderContainer(lumiera::gui::widgets::TimelineWidget *timeline void HeaderContainer::update_headers() { - g_assert(timelineWidget != NULL); + ASSERT(timelineWidget != NULL); - vector< Track* > &tracks = timelineWidget->tracks; - vector< Track* >::iterator i; - for(i = tracks.begin(); i != tracks.end(); i++) + BOOST_FOREACH( Track* track, timelineWidget->tracks ) { - timeline::Track *track = *i; - g_assert(track != NULL); + ASSERT(track != NULL); Glib::RefPtr headerFrame(new Gtk::Frame()); headerFrame->add(track->get_header_widget()); @@ -146,11 +147,9 @@ void HeaderContainer::forall_vfunc(gboolean /* include_internals */, GtkCallback callback, gpointer callback_data) { - vector< RootHeader >::iterator i; - for(i = rootHeaders.begin(); i != rootHeaders.end(); i++) + BOOST_FOREACH( RootHeader &header, rootHeaders ) { - RootHeader header = *i; - g_assert(header.widget); + ASSERT(header.widget); callback(header.widget->gobj(), callback_data); } } @@ -166,21 +165,20 @@ HeaderContainer::on_scroll() void HeaderContainer::layout_headers() { - g_assert(timelineWidget != NULL); + ASSERT(timelineWidget != NULL); int offset = 0; const int y_scroll_offset = timelineWidget->get_y_scroll_offset(); const Allocation container_allocation = get_allocation(); - vector< RootHeader >::iterator i; - for(i = rootHeaders.begin(); i != rootHeaders.end(); i++) + BOOST_FOREACH( RootHeader &header, rootHeaders ) { - RootHeader header = *i; - g_assert(header.widget); - g_assert(header.track != NULL); + ASSERT(header.widget); + ASSERT(header.track != NULL); const int height = header.track->get_height(); + ASSERT(height >= 0); Gtk::Allocation header_allocation; header_allocation.set_x (0); diff --git a/src/gui/widgets/timeline/timeline-body.cpp b/src/gui/widgets/timeline/timeline-body.cpp index 859abb0e8..bbcca9a02 100644 --- a/src/gui/widgets/timeline/timeline-body.cpp +++ b/src/gui/widgets/timeline/timeline-body.cpp @@ -21,6 +21,7 @@ * *****************************************************/ #include +#include #include "timeline-body.hpp" #include "../timeline-widget.hpp" @@ -39,7 +40,7 @@ TimelineBody::TimelineBody(lumiera::gui::widgets::TimelineWidget *timeline_widge Glib::ObjectBase("TimelineBody"), timelineWidget(timeline_widget) { - g_assert(timelineWidget != NULL); + REQUIRE(timelineWidget != NULL); // Connect up some events timelineWidget->horizontalAdjustment.signal_value_changed().connect( @@ -84,28 +85,26 @@ TimelineBody::on_expose_event(GdkEventExpose* event) -(int)timelineWidget->verticalAdjustment.get_value()); // Interate drawing each track - vector::iterator i; - for(i = timelineWidget->tracks.begin(); - i != timelineWidget->tracks.end(); i++) - { - timeline::Track *track = *i; - g_assert(track != NULL); + BOOST_FOREACH( Track* track, timelineWidget->tracks ) + { + ASSERT(track != NULL); - const int track_height = track->get_height(); - - // Draw the track background - cairo->rectangle(0, 0, allocation.get_width(), track_height); - gdk_cairo_set_source_color(cairo->cobj(), &track_background); - cairo->fill(); - - // Render the track - cairo->save(); - track->draw_track(cairo); - cairo->restore(); + const int height = track->get_height(); + ASSERT(height >= 0); - // Shift for the next track - cairo->translate(0, track_height + TimelineWidget::TrackPadding); - } + // Draw the track background + cairo->rectangle(0, 0, allocation.get_width(), height); + gdk_cairo_set_source_color(cairo->cobj(), &track_background); + cairo->fill(); + + // Render the track + cairo->save(); + track->draw_track(cairo); + cairo->restore(); + + // Shift for the next track + cairo->translate(0, height + TimelineWidget::TrackPadding); + } return true; } @@ -122,7 +121,7 @@ TimelineBody::read_styles() track_background = *colour; else { - g_warning("track_background style value failed to load"); + WARN(gui, "track_background style value failed to load"); track_background.red = 0x0000; track_background.green = 0x0000; track_background.blue = 0x0000; diff --git a/src/gui/widgets/video-display-widget.cpp b/src/gui/widgets/video-display-widget.cpp index 2c7be8111..cbd4b38fd 100644 --- a/src/gui/widgets/video-display-widget.cpp +++ b/src/gui/widgets/video-display-widget.cpp @@ -24,6 +24,8 @@ #include #include +#include "../gtk-lumiera.hpp" + #include "../output/xvdisplayer.hpp" #include "../output/gdkdisplayer.hpp" @@ -137,19 +139,22 @@ VideoDisplayWidget::on_expose_event(GdkEventExpose* event) Displayer* VideoDisplayWidget::createDisplayer( Gtk::Widget *drawingArea, int width, int height ) { + REQUIRE(drawingArea != NULL); + REQUIRE(width >= 0 && height >= 0); + Displayer *displayer = NULL; - + displayer = new XvDisplayer( drawingArea, width, height ); if ( !displayer->usable() ) - { - delete displayer; - displayer = NULL; - } + { + delete displayer; + displayer = NULL; + } if ( displayer == NULL ) - { - displayer = new GdkDisplayer( drawingArea, width, height ); - } + { + displayer = new GdkDisplayer( drawingArea, width, height ); + } return displayer; } diff --git a/src/gui/workspace/actions.hpp b/src/gui/workspace/actions.hpp index c68ce8de4..891ae7757 100644 --- a/src/gui/workspace/actions.hpp +++ b/src/gui/workspace/actions.hpp @@ -29,7 +29,7 @@ #ifndef ACTIONS_HPP #define ACTIONS_HPP -#include +#include "../gtk-lumiera.hpp" namespace lumiera { namespace gui { diff --git a/src/gui/workspace/workspace-window.cpp b/src/gui/workspace/workspace-window.cpp index c2c46d61b..3e72d20d6 100644 --- a/src/gui/workspace/workspace-window.cpp +++ b/src/gui/workspace/workspace-window.cpp @@ -42,22 +42,24 @@ namespace lumiera { namespace gui { namespace workspace { - WorkspaceWindow::WorkspaceWindow(Project *source_project) : - project(source_project), - actions(*this) +WorkspaceWindow::WorkspaceWindow(Project *source_project) : + project(source_project), + actions(*this) { + REQUIRE(source_project != NULL); + layout = NULL; create_ui(); } - WorkspaceWindow::~WorkspaceWindow() +WorkspaceWindow::~WorkspaceWindow() { if(layout != NULL) g_object_unref(layout); } - void - WorkspaceWindow::create_ui() +void +WorkspaceWindow::create_ui() { //----- Configure the Window -----// set_title(AppTitle); @@ -106,23 +108,23 @@ namespace workspace { ""; try - { - uiManager->add_ui_from_string(ui_info); - } + { + uiManager->add_ui_from_string(ui_info); + } catch(const Glib::Error& ex) - { - g_error("Building menus failed: %s", ex.what().data()); - return; - } + { + ERROR(gui, "Building menus failed: %s", ex.what().data()); + return; + } //----- Set up the Menu Bar -----// Gtk::Widget* menu_bar = uiManager->get_widget("/MenuBar"); - g_assert(menu_bar != NULL); + ASSERT(menu_bar != NULL); base_container.pack_start(*menu_bar, Gtk::PACK_SHRINK); //----- Set up the Tool Bar -----// Gtk::Toolbar* toolbar = dynamic_cast(uiManager->get_widget("/ToolBar")); - g_assert(toolbar != NULL); + ASSERT(toolbar != NULL); toolbar->set_toolbar_style(TOOLBAR_ICONS); base_container.pack_start(*toolbar, Gtk::PACK_SHRINK); From 6f6fab38dc6eb17d502aa3815f47ff9fbb5444d8 Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Tue, 10 Jun 2008 23:46:11 +0100 Subject: [PATCH 057/110] Corrected somethings in configure.ac that were in wrong order --- configure.ac | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/configure.ac b/configure.ac index b06820e0e..641741e83 100644 --- a/configure.ac +++ b/configure.ac @@ -120,17 +120,6 @@ AC_CHECK_HEADER([boost/regex.hpp], AC_LANG_POP([C++]) - -# Print a summary -AC_MSG_RESULT([ -Configuration Summary:]) -AC_MSG_RESULT([ NoBug build level: $nobug_level]) -# Add more summary results here - -AC_MSG_RESULT([ -Configuration complete, you can now build Lumiera with 'make' -]) - ############## Internatinalization #GETTEXT_PACKAGE=gtk-lumiera #AC_SUBST(GETTEXT_PACKAGE) @@ -176,6 +165,15 @@ AC_SUBST(GTK_LUMIERA_LIBS) # END Gtk Dependancies +# Print a summary +AC_MSG_RESULT([ +Configuration Summary:]) +AC_MSG_RESULT([ NoBug build level: $nobug_level]) +# Add more summary results here + +AC_MSG_RESULT([ +Configuration complete, you can now build Lumiera with 'make' +]) AC_CONFIG_FILES(Makefile) AC_OUTPUT From 3cc0f723898170913681553f5538ee03edecc927 Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Wed, 18 Jun 2008 23:57:47 +0100 Subject: [PATCH 058/110] Trivial timeline now works - more work coming --- configure.ac | 4 +- src/gui/Makefile.am | 8 +- src/gui/gtk-lumiera.hpp | 2 + src/gui/lumiera_ui.rc | 24 +++-- src/gui/output/gdkdisplayer.cpp | 4 +- src/gui/widgets/timeline-widget.cpp | 3 +- src/gui/widgets/timeline-widget.hpp | 5 +- src/gui/widgets/timeline/timeline-body.cpp | 23 ++-- src/gui/widgets/timeline/timeline-body.hpp | 6 +- src/gui/widgets/timeline/timeline-ruler.cpp | 112 ++++++++++++++++++++ src/gui/widgets/timeline/timeline-ruler.hpp | 60 +++++++++++ src/gui/widgets/video-display-widget.cpp | 2 +- src/gui/window-manager.cpp | 51 ++++++--- src/gui/window-manager.hpp | 8 +- src/gui/workspace/actions.cpp | 1 - src/lib/Makefile.am | 5 +- src/lib/time.c | 54 ++++++++++ src/lib/time.h | 38 +++++++ 18 files changed, 351 insertions(+), 59 deletions(-) create mode 100644 src/gui/widgets/timeline/timeline-ruler.cpp create mode 100644 src/gui/widgets/timeline/timeline-ruler.hpp create mode 100644 src/lib/time.c create mode 100644 src/lib/time.h diff --git a/configure.ac b/configure.ac index 641741e83..ae9e3ee89 100644 --- a/configure.ac +++ b/configure.ac @@ -157,8 +157,8 @@ AC_CHECK_LIB(Xv, XvQueryAdaptors, , # END X11 Dependancies -############## Gtk Dependancies -PKG_CHECK_MODULES(GTK_LUMIERA, [gtkmm-2.4 >= 2.8 gdl-1.0 >= 0.6.1 cairomm-1.0 >= 0.6.0]) +############## Pkg Dependancies +PKG_CHECK_MODULES(GTK_LUMIERA, [gtkmm-2.4 >= 2.8 gdl-1.0 >= 0.6.1 cairomm-1.0 >= 0.6.0 gavl >= 0.2.5]) AC_SUBST(GTK_LUMIERA_CFLAGS) AC_SUBST(GTK_LUMIERA_LIBS) diff --git a/src/gui/Makefile.am b/src/gui/Makefile.am index fe4a1543f..b1560e485 100644 --- a/src/gui/Makefile.am +++ b/src/gui/Makefile.am @@ -27,10 +27,6 @@ INCLUDES = \ -DPACKAGE_DATA_DIR=\""$(datadir)"\" \ $(GTK_LUMIERA_CFLAGS) -AM_CFLAGS =\ - -Wall\ - -g - bin_PROGRAMS += lumigui lumigui_SOURCES = \ @@ -66,6 +62,8 @@ lumigui_SOURCES = \ $(lumigui_srcdir)/widgets/timeline/video-track.hpp \ $(lumigui_srcdir)/widgets/timeline/timeline-body.cpp \ $(lumigui_srcdir)/widgets/timeline/timeline-body.hpp \ + $(lumigui_srcdir)/widgets/timeline/timeline-ruler.cpp \ + $(lumigui_srcdir)/widgets/timeline/timeline-ruler.hpp \ $(lumigui_srcdir)/model/project.cpp \ $(lumigui_srcdir)/model/project.hpp \ $(lumigui_srcdir)/output/displayer.cpp \ @@ -76,7 +74,7 @@ lumigui_SOURCES = \ $(lumigui_srcdir)/output/xvdisplayer.hpp lumigui_LDFLAGS = -lumigui_LDADD = $(GTK_LUMIERA_LIBS) +lumigui_LDADD = $(GTK_LUMIERA_LIBS) liblumicommon.a liblumi.a lumigui_DEPENDENCIES = \ $(top_builddir)/lumiera_ui.rc \ diff --git a/src/gui/gtk-lumiera.hpp b/src/gui/gtk-lumiera.hpp index 6cf7d3acc..fef358a34 100644 --- a/src/gui/gtk-lumiera.hpp +++ b/src/gui/gtk-lumiera.hpp @@ -31,6 +31,8 @@ #include #include + + NOBUG_DECLARE_FLAG(gui); #ifdef ENABLE_NLS diff --git a/src/gui/lumiera_ui.rc b/src/gui/lumiera_ui.rc index b2d951ae1..59a021ac5 100644 --- a/src/gui/lumiera_ui.rc +++ b/src/gui/lumiera_ui.rc @@ -7,7 +7,7 @@ style "medium_text" { - font_name = "sans bold 10" + font_name = "sans 10" } style "medium_bold_entry" = "medium_text" @@ -115,20 +115,28 @@ class "GtkProgressBar" style:highest "lumiera_progressbars" style "timeline_body" { - gtkmm__CustomObject_TimelineBody::track_background = "#7E838B" + gtkmm__CustomObject_TimelineBody::background = "#7E838B" +} + +style "timeline_ruler" = "default_base" +{ +# gtkmm__CustomObject_TimelineRuler::background = "#0000FF" +# gtkmm__CustomObject_TimelineRuler::annotations = "#00FF00" } style "timeline_header_base" = "default_base" { - fg[NORMAL] = { 0.77, 0.77, 0.72 } - bg[NORMAL] = { 0.18, 0.19, 0.22 } - bg[ACTIVE] = { 0.20, 0.20, 0.20 } - bg[PRELIGHT] = { 0.20, 0.20, 0.20 } - bg[INSENSITIVE] = { 0.20, 0.20, 0.20 } - bg[SELECTED] = { 0.20, 0.20, 0.20 } +# fg[NORMAL] = { 0.77, 0.77, 0.72 } +# bg[NORMAL] = { 0.18, 0.19, 0.22 } +# bg[ACTIVE] = { 0.20, 0.20, 0.20 } +# bg[PRELIGHT] = { 0.20, 0.20, 0.20 } +# bg[INSENSITIVE] = { 0.20, 0.20, 0.20 } +# bg[SELECTED] = { 0.20, 0.20, 0.20 } } class "gtkmm__CustomObject_TimelineBody" style:highest "timeline_body" +class "gtkmm__CustomObject_TimelineRuler" style:highest "timeline_ruler" widget "*TimelineHeaderBaseUnselected" style:highest "timeline_header_base" + diff --git a/src/gui/output/gdkdisplayer.cpp b/src/gui/output/gdkdisplayer.cpp index 68ad6d545..3718b9f1e 100644 --- a/src/gui/output/gdkdisplayer.cpp +++ b/src/gui/output/gdkdisplayer.cpp @@ -39,8 +39,8 @@ GdkDisplayer::GdkDisplayer( Gtk::Widget *drawing_area, int width, int height ) : drawingArea( drawing_area ) { REQUIRE(drawing_area != NULL); - REQUIRE(imageWidth > 0); - REQUIRE(imageHeight > 0); + REQUIRE(width > 0); + REQUIRE(height > 0); imageWidth = width, imageHeight = height; } diff --git a/src/gui/widgets/timeline-widget.cpp b/src/gui/widgets/timeline-widget.cpp index 240cb09fb..0178a3f3c 100644 --- a/src/gui/widgets/timeline-widget.cpp +++ b/src/gui/widgets/timeline-widget.cpp @@ -41,8 +41,7 @@ TimelineWidget::TimelineWidget() : horizontalAdjustment(0, 0, 0), verticalAdjustment(0, 0, 0), horizontalScroll(horizontalAdjustment), - verticalScroll(verticalAdjustment), - ruler("ruler") + verticalScroll(verticalAdjustment) { body = new TimelineBody(this); ASSERT(body != NULL); diff --git a/src/gui/widgets/timeline-widget.hpp b/src/gui/widgets/timeline-widget.hpp index a53ef6368..9943e85da 100644 --- a/src/gui/widgets/timeline-widget.hpp +++ b/src/gui/widgets/timeline-widget.hpp @@ -29,6 +29,7 @@ #include "../gtk-lumiera.hpp" #include "timeline/header-container.hpp" #include "timeline/timeline-body.hpp" +#include "timeline/timeline-ruler.hpp" #include "timeline/track.hpp" #include "timeline/video-track.hpp" @@ -67,9 +68,9 @@ class TimelineWidget : public Gtk::Table timeline::VideoTrack video2; std::vector tracks; - timeline::TimelineBody *body; timeline::HeaderContainer *headerContainer; - Gtk::Label ruler; + timeline::TimelineBody *body; + timeline::TimelineRuler ruler; Gtk::Adjustment horizontalAdjustment, verticalAdjustment; Gtk::HScrollbar horizontalScroll; diff --git a/src/gui/widgets/timeline/timeline-body.cpp b/src/gui/widgets/timeline/timeline-body.cpp index bbcca9a02..aaf0b9d26 100644 --- a/src/gui/widgets/timeline/timeline-body.cpp +++ b/src/gui/widgets/timeline/timeline-body.cpp @@ -25,9 +25,11 @@ #include "timeline-body.hpp" #include "../timeline-widget.hpp" +#include "../../window-manager.hpp" using namespace Gtk; using namespace std; +using namespace lumiera::gui; using namespace lumiera::gui::widgets; using namespace lumiera::gui::widgets::timeline; @@ -51,7 +53,7 @@ TimelineBody::TimelineBody(lumiera::gui::widgets::TimelineWidget *timeline_widge // Install style properties gtk_widget_class_install_style_property( GTK_WIDGET_CLASS(G_OBJECT_GET_CLASS(gobj())), - g_param_spec_boxed("track_background", + g_param_spec_boxed("background", "Track Background", "The background colour of timeline tracks", GDK_TYPE_COLOR, G_PARAM_READABLE)); @@ -94,7 +96,7 @@ TimelineBody::on_expose_event(GdkEventExpose* event) // Draw the track background cairo->rectangle(0, 0, allocation.get_width(), height); - gdk_cairo_set_source_color(cairo->cobj(), &track_background); + gdk_cairo_set_source_color(cairo->cobj(), &background); cairo->fill(); // Render the track @@ -112,21 +114,8 @@ TimelineBody::on_expose_event(GdkEventExpose* event) void TimelineBody::read_styles() { - GdkColor *colour; - - gtk_widget_style_get(Widget::gobj(), "track_background", &colour, NULL); - - // Did the color load successfully? - if(colour != NULL) - track_background = *colour; - else - { - WARN(gui, "track_background style value failed to load"); - track_background.red = 0x0000; - track_background.green = 0x0000; - track_background.blue = 0x0000; - track_background.pixel = 0x00000000; - } + background = WindowManager::read_style_colour_property( + *this, "background", 0, 0, 0); } } // namespace timeline diff --git a/src/gui/widgets/timeline/timeline-body.hpp b/src/gui/widgets/timeline/timeline-body.hpp index d3ba192ab..0b0e37aac 100644 --- a/src/gui/widgets/timeline/timeline-body.hpp +++ b/src/gui/widgets/timeline/timeline-body.hpp @@ -26,7 +26,7 @@ #ifndef TIMELINE_BODY_HPP #define TIMELINE_BODY_HPP -#include +#include "../../gtk-lumiera.hpp" namespace lumiera { namespace gui { @@ -45,14 +45,14 @@ class TimelineBody : public Gtk::DrawingArea protected: void on_scroll(); - virtual bool on_expose_event(GdkEventExpose* event); + bool on_expose_event(GdkEventExpose* event); /* ===== Internals ===== */ private: void read_styles(); private: - GdkColor track_background; + GdkColor background; lumiera::gui::widgets::TimelineWidget *timelineWidget; }; diff --git a/src/gui/widgets/timeline/timeline-ruler.cpp b/src/gui/widgets/timeline/timeline-ruler.cpp new file mode 100644 index 000000000..7970191c9 --- /dev/null +++ b/src/gui/widgets/timeline/timeline-ruler.cpp @@ -0,0 +1,112 @@ +/* + timeline-ruler.cpp - Implementation of the time ruler widget + + Copyright (C) Lumiera.org + 2008, Joel Holdsworth + + 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 + +#include "timeline-ruler.hpp" +#include "../../window-manager.hpp" + +extern "C" { +#include +#include "../../../lib/time.h" +} + +using namespace Gtk; +using namespace std; +using namespace lumiera::gui; +using namespace lumiera::gui::widgets; +using namespace lumiera::gui::widgets::timeline; + +namespace lumiera { +namespace gui { +namespace widgets { +namespace timeline { + +TimelineRuler::TimelineRuler() : + Glib::ObjectBase("TimelineRuler") + { + set_flags(Gtk::NO_WINDOW); // This widget will not have a window + set_size_request(-1, 20); + + // Install style properties + timeScale = GAVL_TIME_SCALE / 200; + timeOffset = 0; + } + +bool +TimelineRuler::on_expose_event(GdkEventExpose* event) + { + // This is where we draw on the window + Glib::RefPtr window = get_window(); + if(!window) + return false; + + // Makes sure the widget styles have been loaded + read_styles(); + + // Prepare to render via cairo + Allocation allocation = get_allocation(); + Glib::RefPtr