Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members Related Pages

# SceneC.h

    00001 //-------------------------------------------------------------------------
    00002 //
    00003 // File:        SceneC.h
    00004 // Desc:        Composition scene class.
    00005 // Author:      memon <memon@inside.org>
    00006 //
    00007 //-------------------------------------------------------------------------
    00008 //  Copyright (c) 2000-2002 Moppi Productions. All Rights Reserved.
    00009 //  This file is part of Moppi Demopaja SDK. For conditions of
    00010 //  distribution and use, see the accompanying license.txt file.
    00011 //  http://moppi.inside.org/demopaja/
    00012 //-------------------------------------------------------------------------
    00013
    00014 #ifndef __DEMOPAJA_SCENEC_H__
    00015 #define __DEMOPAJA_SCENEC_H__
    00016
    00017
    00018 namespace Composition {
    00019     class SceneC;
    00020 };
    00021
    00022 #include "DataBlockI.h"
    00023 #include "EditableI.h"
    00024 #include "UndoC.h"
    00025 #include "LayerC.h"
    00026 #include "PajaTypes.h"
    00027 #include "ColorC.h"
    00028 #include "DeviceContextC.h"
    00029 #include "TimeContextC.h"
    00030 #include <vector>
    00031 #include <string>
    00032
    00033
    00034 namespace Composition {
    00035
    00037
    00045     class SceneC : public Edit::EditableI
    00046     {
    00047     public:
    00049         static SceneC*              create_new();
    00051         virtual Edit::DataBlockI*   create();
    00053         virtual Edit::DataBlockI*   create( Edit::EditableI* pOriginal );
    00055         virtual void                copy( Edit::EditableI* pEditable );
    00057         virtual void                restore( Edit::EditableI* pEditable );
    00058
    00060         void                        set_name( const char* szName );
    00062         const char*                 get_name() const;
    00063
    00065         PajaTypes::uint32           get_layer_count();
    00067         LayerC*                     get_layer( PajaTypes::uint32 ui32Index );
    00069         LayerC*                     add_layer();
    00071         void                        del_layer( PajaTypes::uint32 ui32Index );
    00073
    00077         void                        move_layer_before( PajaTypes::uint32 ui32Index, PajaTypes::uint32 ui32IndexBefore );
    00078
    00080         PajaTypes::int32            get_beats_per_min();
    00082         void                        set_beats_per_min( PajaTypes::int32 i32BeatsPerMin );
    00083
    00085         PajaTypes::int32            get_edit_accuracy();
    00087         void                        set_edit_accuracy( PajaTypes::int32 i32Accuracy );
    00088
    00090         PajaTypes::int32            get_beats_per_measure();
    00092         void                        set_beats_per_measure( PajaTypes::int32 i32Beats );
    00093
    00095         PajaTypes::int32            get_qnotes_per_beat();
    00097         void                        set_qnotes_per_beat( PajaTypes::int32 i32QNotes );
    00098
    00100         PajaTypes::int32            get_music_start_time() const;
    00102         void                        set_music_start_time( PajaTypes::int32 i32Time );
    00103
    00105         PajaTypes::int32            get_time() const;
    00107         void                        set_time( PajaTypes::int32 i32Time );
    00109
    00111         PajaTypes::int32            get_duration();
    00113         void                        set_duration( PajaTypes::int32 i32Duration );
    00114
    00116         PajaTypes::int32            get_layout_width();
    00118         void                        set_layout_width( PajaTypes::int32 i32Width );
    00119
    00121         PajaTypes::int32            get_layout_height();
    00123         void                        set_layout_height( PajaTypes::int32 i32Height );
    00124
    00126         const PajaTypes::ColorC&    get_layout_color() const;
    00127
    00129         void                        set_layout_color( const PajaTypes::ColorC& rCol );
    00130
    00131
    00133         PajaTypes::uint32           get_marker_count() const;
    00135         PajaTypes::int32            get_marker_time( PajaTypes::uint32 ui32Index ) const;
    00137         const char*                 get_marker_name( PajaTypes::uint32 ui32Index ) const;
    00138
    00140         void                        set_marker_time( PajaTypes::uint32 ui32Index, PajaTypes::int32 i32Time );
    00142         void                        set_marker_name( PajaTypes::uint32 ui32Index, const char* szName );
    00143
    00145         void                        add_marker( PajaTypes::int32 i32Time, const char* szName );
    00147         void                        del_marker( PajaTypes::uint32 ui32Index );
    00149         void                        sort_markers();
    00150
    00152         void                        initialize( PajaTypes::uint32 ui32Reason, PajaSystem::DeviceContextC* pContext, PajaSystem::TimeContextC* pTimeContext );
    00153
    00155         PajaTypes::uint32           save( FileIO::SaveC* pSave );
    00157         PajaTypes::uint32           load( FileIO::LoadC* pLoad );
    00159         PajaTypes::uint32           load( FileIO::LoadC* pLoad, bool bMerge );
    00160
    00161     protected:
    00163         SceneC();
    00165         SceneC( Edit::EditableI* pOriginal );
    00167         virtual ~SceneC();
    00168
    00169     private:
    00170
    00171         static int  compare_func( const void* vpParam1, const void* vpParam2 );
    00172
    00173         struct MarkerS {
    00174             PajaTypes::int32    m_i32Time;
    00175             std::string         m_sName;
    00176         };
    00177
    00178         std::vector<MarkerS>        m_rMarkers;
    00179         std::string                 m_sName;
    00180         std::vector<LayerC*>        m_rLayers;
    00181         PajaTypes::int32            m_i32BeatsPerMin;
    00182         PajaTypes::int32            m_i32EditAccuracy;
    00183         PajaTypes::int32            m_i32BeatsPerMeasure;
    00184         PajaTypes::int32            m_i32QNotesPerBeat;
    00185         PajaTypes::int32            m_i32Duration;
    00186         PajaTypes::int32            m_i32LayoutWidth;
    00187         PajaTypes::int32            m_i32LayoutHeight;
    00188         PajaTypes::int32            m_i32Time;
    00189         PajaTypes::int32            m_i32MusicStartTime;
    00190         PajaTypes::ColorC           m_rLayoutColor;
    00191     };
    00192
    00193 };
    00194
    00195 #endif // __DEMOPAJA_SCENEC_H__