Changeset 10
- Timestamp:
- 04/20/07 09:30:57 (2 years ago)
- Files:
-
- trunk/pihlaja/src/build/pihlaja.brf (modified) (1 diff)
- trunk/pihlaja/src/pihlaja/core/discoverer.d (modified) (4 diffs)
- trunk/pihlaja/src/pihlaja/core/edit.d (modified) (1 diff)
- trunk/pihlaja/src/pihlaja/core/material.d (modified) (5 diffs)
- trunk/pihlaja/src/pihlaja/core/movie.d (modified) (8 diffs)
- trunk/pihlaja/src/pihlaja/core/project.d (modified) (8 diffs)
- trunk/pihlaja/src/pihlaja/core/scene.d (modified) (9 diffs)
- trunk/pihlaja/src/pihlaja/core/scenechain.d (modified) (2 diffs)
- trunk/pihlaja/src/pihlaja/core/track.d (modified) (1 diff)
- trunk/pihlaja/src/pihlaja/pihlajamain.d (modified) (3 diffs)
- trunk/pihlaja/src/pihlaja/ui/materialstreeview.d (modified) (4 diffs)
- trunk/pihlaja/src/pihlaja/ui/projectchooser.d (modified) (3 diffs)
- trunk/pihlaja/src/pihlaja/ui/projectwindow.d (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/pihlaja/src/build/pihlaja.brf
r8 r10 6 6 #-v 7 7 #-debug=15 8 -debug=gstreamer 9 -debug=gstreamerbus 8 #-debug=gstreamer 9 #-debug=gstreamerbus 10 -debug=loading 10 11 -debug=Pihlaja 11 12 -debug=Project 12 13 -debug=Movie 13 14 -debug=Scene 14 -debug=LinkableScene15 #-debug=LinkableScene 15 16 -debug=SceneChain 16 -debug=Track17 -debug=MaterialsTreeview17 #-debug=Track 18 #-debug=MaterialsTreeview 18 19 #-debug=Render 19 20 #-debug=Invalidation trunk/pihlaja/src/pihlaja/core/discoverer.d
r5 r10 632 632 found_video = true; 633 633 currentVideoMaterial = new Material( current, MaterialType.VIDEO, pad_duration ); 634 project. newMaterial( currentVideoMaterial );634 project.addMaterial( currentVideoMaterial ); 635 635 //TODO currentVideoMaterial.setAudioInfo(caps) 636 636 } … … 640 640 found_audio = true; 641 641 currentAudioMaterial = new Material( current, MaterialType.AUDIO, pad_duration ); 642 project. newMaterial( currentAudioMaterial );642 project.addMaterial( currentAudioMaterial ); 643 643 //TODO currentVideoMaterial.setVideoInfo(caps) 644 644 } … … 867 867 found_video = true; 868 868 currentVideoMaterial = new Material( current, MaterialType.VIDEO, pad_duration ); 869 project. newMaterial( currentVideoMaterial );869 project.addMaterial( currentVideoMaterial ); 870 870 debug(Discoverer) writefln("Discoverer.newDecodedPadCb() Creating new video material. DONE."); 871 871 //TODO currentVideoMaterial.setAudioInfo(caps) … … 887 887 found_audio = true; 888 888 currentAudioMaterial = new Material( current, MaterialType.AUDIO, pad_duration ); 889 project. newMaterial( currentAudioMaterial );889 project.addMaterial( currentAudioMaterial ); 890 890 //TODO currentAudioMaterial.setVideoInfo(caps) 891 891 debug(Discoverer) writefln("Discoverer.newDecodedPadCb() Creating new audio material. DONE."); trunk/pihlaja/src/pihlaja/core/edit.d
r9 r10 188 188 parent_node.addChild( edit_node ); 189 189 edit_node.setAttribute( "name", name ); 190 edit_node.setAttribute( " x", x);191 edit_node.setAttribute( " y", y);192 edit_node.setAttribute( " w", w );193 edit_node.setAttribute( "h", h ); 190 edit_node.setAttribute( "start", start ); 191 edit_node.setAttribute( "duration", duration ); 192 edit_node.setAttribute( "y", y );//This might not be needed and maybe it should be removed. 193 edit_node.setAttribute( "h", h );//This might not be needed and maybe it should be removed. 194 194 //This isn't needed as the Track is known: edit_node.setAttribute( "trackNumber", trackNumber() ); 195 195 //This isn't needed as the Track is known: edit_node.setAttribute( "mediaType", track.mediaTypeString() ); 196 196 edit_node.setAttribute( "mediaStart", mediaStart ); 197 197 edit_node.setAttribute( "mediaDuration", mediaDuration ); 198 198 edit_node.setAttribute( "materialID", material.id ); 199 199 200 200 } trunk/pihlaja/src/pihlaja/core/material.d
r9 r10 16 16 private import gstreamerc.gstreamertypes; 17 17 18 //PTL imports: 19 private import ptl.xml; 20 18 21 //Pihlaja imports: 19 22 … … 29 32 VIDEO, 30 33 AUDIO, 31 MUSIC, 32 IMAGE, 33 IMAGE_SEQUENCE, 34 LINK 34 MUSIC,//TODO 35 IMAGE,//TODO 36 IMAGE_SEQUENCE,//TODO 37 LINK//TODO 35 38 } 36 39 … … 49 52 public: 50 53 54 public char[] id() { return m_id; } 55 protected char[] id( char[] set ) { return m_id = set; } 56 protected char[] m_id; 57 51 58 this( char[] fnam, MaterialType set_mater_type, double set_duration )// = "untitled" ) 52 59 { … … 55 62 56 63 debug(Discoverer) writefln("Creating new Material: ", fnam ); 64 65 id = std.string.toString( cast(size_t)cast(void*)this ); 57 66 58 67 /* … … 76 85 mediaDuration = set_duration; //* 25.0; 77 86 87 } 88 89 static Material load003( XmlNode xml_node ) 90 { 91 Material empty = new Material( xml_node.getAttribute( "filename" ), materialTypeFromString( xml_node.getAttribute( "materialType" ) ), std.string.atof( xml_node.getAttribute( "mediaDuration" )) ); 92 93 /*XmlNode[] child_nodes = xml_node.getChildren(); 94 95 foreach( XmlNode ch_node; child_nodes ) 96 { 97 if( ch_node.getName() == "SceneChain") 98 { 99 debug(loading) writefln("- Found SceneChain."); 100 sceneChain.pushBack( SceneChain.load003( this, ch_node ) ); 101 } 102 }*/ 103 104 return empty; 105 106 } 107 108 void save003( XmlNode parent_node ) 109 { 110 XmlNode material_node = new XmlNode("Material"); 111 parent_node.addChild( material_node ); 112 material_node.setAttribute( "id:", id ); 113 material_node.setAttribute( "filename", filename ); 114 material_node.setAttribute( "mediaStart", mediaStart ); 115 material_node.setAttribute( "mediaDuration", mediaDuration ); 116 material_node.setAttribute( "materialType", materialTypeString() ); 117 118 } 119 120 static MaterialType materialTypeFromString( char[] from ) 121 { 122 if( from == "video" ) 123 return MaterialType.VIDEO; 124 else if( from == "audio" ) 125 return MaterialType.AUDIO; 126 else if( from == "music" ) 127 return MaterialType.MUSIC; 128 else if( from == "image" ) 129 return MaterialType.IMAGE; 130 else if( from == "image_sequence" ) 131 return MaterialType.IMAGE_SEQUENCE; 132 else if( from == "link" ) 133 return MaterialType.LINK; 134 return MaterialType.NONE; 135 } 136 137 char[] materialTypeString() 138 { 139 if( materialType == MaterialType.VIDEO ) 140 return "video"; 141 else if( materialType == MaterialType.AUDIO ) 142 return "audio"; 143 else if( materialType == MaterialType.MUSIC ) 144 return "music"; 145 else if( materialType == MaterialType.IMAGE ) 146 return "image"; 147 else if( materialType == MaterialType.IMAGE_SEQUENCE ) 148 return "image_sequence"; 149 else if( materialType == MaterialType.LINK ) 150 return "link"; 151 return "none"; 78 152 } 79 153 trunk/pihlaja/src/pihlaja/core/movie.d
r9 r10 61 61 { 62 62 public: 63 this( Project set_project, char[] set_name = "Untitled movie" )63 this( Project set_project, char[] set_name = "Untitled_movie" ) 64 64 { 65 65 debug(Movie) writefln("Movie.this() START."); … … 77 77 78 78 m_name = set_name; 79 if( m_name == "Untitled movie" )79 if( m_name == "Untitled_movie" ) 80 80 m_name = m_name ~ std.string.toString( count_times ); 81 81 … … 83 83 84 84 pipeline = new Pipeline( "movie-pipeline" ~ std.string.toString( count_times ) ); 85 86 SceneChain empty_chain = new SceneChain( this ); 87 startScene = new StartScene( this, empty_chain ); 88 sceneChain.pushBack( empty_chain ); 89 addItem( startScene ); 90 startScene.addOnEvent( &onSceneEvent ); 85 91 86 92 /* … … 135 141 selectedSceneChains = new List!(LinkableScene); 136 142 143 } 144 145 static Movie load003( Project set_project, XmlNode xml_node ) 146 { 147 Movie empty = new Movie( set_project, xml_node.getAttribute( "name" ) ); 148 149 XmlNode[] child_nodes = xml_node.getChildren(); 150 151 foreach( XmlNode ch_node; child_nodes ) 152 { 153 if( ch_node.getName() == "SceneChain") 154 { 155 debug(loading) writefln("- Found SceneChain."); 156 empty.sceneChain.pushBack( SceneChain.load003( empty, ch_node ) ); 157 } 158 } 159 160 return empty; 137 161 } 138 162 … … 154 178 //createTestScene(); 155 179 156 SceneChain empty_chain = new SceneChain( this );157 startScene = new StartScene( this, empty_chain );158 sceneChain.pushBack( empty_chain );159 addItem( startScene );160 startScene.addOnEvent( &onSceneEvent );161 180 selectedScene = startScene; 162 181 … … 194 213 count_create_test_scene_number++; 195 214 196 //newScene( -350.0, -70.0, 250.0, 200.0, "10sec Scene " ~ std.string.toString(count_create_test_scene_number) );197 Scene test_scene = newScene( centerX, centerY, 250.0, 200.0, "10sec Scene" ~ std.string.toString(count_create_test_scene_number) );215 //newScene( -350.0, -70.0, 250.0, 200.0, "10sec_Scene " ~ std.string.toString(count_create_test_scene_number) ); 216 Scene test_scene = newScene( centerX, centerY, 250.0, 200.0, "10sec_Scene_" ~ std.string.toString(count_create_test_scene_number) ); 198 217 //newTrack( MediaType.VIDEO, false, "Video 2" ); 199 218 … … 777 796 } 778 797 798 Scene addScene( Scene empty ) 799 { 800 addItem( empty ); 801 scene.pushBack( empty ); 802 empty.addOnEvent( &onSceneEvent ); 803 return empty; 804 } 805 779 806 Scene newScene( double sx1 = 0.0, double sy1 = 0.0, double sx2 = 30.0, double sy2 = 30.0, String set_name = "Empty Scene" ) 780 807 { … … 2044 2071 Element audio1;*/ 2045 2072 2046 StartScene startScene; 2073 public StartScene startScene() { return m_startScene; }//SceneChain needs this while loading. 2074 protected StartScene startScene( StartScene set ) { return m_startScene = set; } 2075 protected StartScene m_startScene; 2047 2076 2048 2077 LinkableScene m_selectedScene; trunk/pihlaja/src/pihlaja/core/project.d
r9 r10 497 497 discoverer = new Discoverer(this); 498 498 499 newMovie();499 //newMovie(); 500 500 501 501 } … … 511 511 { 512 512 currentVersion++; 513 currentVersionFilename = projectDir ~ std.path.sep ~ "version" ~ std.string.toString( currentVersion ); 513 currentVersionFilename = projectDir ~ std.path.sep ~ "version" ~ std.string.toString( currentVersion ) ~ ".pihlajaproject"; 514 } 515 516 void load003( std.stream.File file ) 517 { 518 XmlNode xml_node = readDocument(file); 519 if( xml_node.getName() != "Pihlaja" ) 520 { 521 writefln("The first node isn't named Pihlaja. This is an invalid pihlajaproject file. Can't open it."); 522 return; 523 } 524 char[] file_format_version = xml_node.getAttribute( "fileFormatVersion" ); 525 if( file_format_version != "003" ) 526 { 527 writefln("This project file might not open correctly as it's fileFormatVersion is ", file_format_version, "This version of Pihlaja fully supports only version 003." ); 528 } 529 530 XmlNode[] project_nodes = xml_node.getChildren(); 531 532 foreach( XmlNode node; project_nodes ) 533 { 534 name = node.getAttribute( "name" ); 535 currentVersion = std.string.atoi( node.getAttribute( "currentVersion" ) ); 536 projectDir = node.getAttribute( "projectDir" ); 537 currentVersionFilename = node.getAttribute( "currentVersionFilename" ); 538 539 debug(loading) 540 { 541 writefln("read name: ", name ); 542 writefln("read currentVersion: ", currentVersion ); 543 writefln("read projectDir: ", projectDir ); 544 writefln("read currentVersionFilename: ", currentVersionFilename ); 545 } 546 547 XmlNode[] project_child_nodes = node.getChildren(); 548 549 foreach( XmlNode mov_node; project_child_nodes ) 550 { 551 if( mov_node.getName() == "Material" ) 552 { 553 debug(loading) writefln("- Found Material."); 554 addMaterial( Material.load003( mov_node ) ); 555 } 556 else if( mov_node.getName() == "Movie" ) 557 { 558 debug(loading) writefln("- Found Movie."); 559 addMovie( Movie.load003( this, mov_node ) ); 560 } 561 } 562 } 563 514 564 } 515 565 … … 529 579 project_node.setAttribute( "currentVersionFilename", currentVersionFilename ); 530 580 581 foreach( Material mat; material ) 582 { 583 mat.save003( project_node ); 584 } 585 531 586 foreach( Movie mov; movie ) 532 587 { … … 576 631 } 577 632 633 abstract protected void addMovieToBin( Movie set_movie ); 634 635 Movie addMovie( Movie set_movie ) 636 { 637 debug(Project) writefln("Project.addMovie(Movie) START."); 638 debug(Project) scope(exit) writefln("Project.addMovie(Movie) END."); 639 640 movie.pushBack( set_movie ); 641 selectedMovie = set_movie; 642 addMovieToBin( set_movie ); 643 return set_movie; 644 } 645 578 646 Movie newMovie() 579 647 { … … 582 650 583 651 Movie empty = new Movie( this ); 584 movie.pushBack( empty ); 585 selectedMovie = empty; 652 //movie.pushBack( empty ); 653 //selectedMovie = empty; 654 addMovie( empty ); 586 655 return empty; 587 656 } … … 612 681 Material mat3 = new Material( "/home/joonaz/sax.ogg", MaterialType.AUDIO, 10.0 * 25.0 ); 613 682 614 newMaterial( mat1 );615 newMaterial( mat2 );616 newMaterial( mat3 );617 newMaterial( mat4 );683 addMaterial( mat1 ); 684 addMaterial( mat2 ); 685 addMaterial( mat3 ); 686 addMaterial( mat4 ); 618 687 619 688 } … … 631 700 } 632 701 633 Material newMaterial( Material set_material )634 { 635 debug(Discoverer) writefln("Project. newMaterial() START.");636 debug(Discoverer) scope(exit) writefln("Project. newMaterial() END.");702 Material addMaterial( Material set_material ) 703 { 704 debug(Discoverer) writefln("Project.addMaterial() START."); 705 debug(Discoverer) scope(exit) writefln("Project.addMaterial() END."); 637 706 638 707 //Material empty = new Material( filenam, typ ); … … 732 801 733 802 char[] projectDir; 734 char[] currentVersionFilename; 803 char[] currentVersionFilename;//This is only used when saving... 804 char[] currentFilename() { return projectDir ~ std.path.sep ~ "current.pihlajaproject"; }//This is used when opening the filename. 735 805 uint currentVersion = 0;//This is the current version of the project. 736 806 //It is incremented everytime saving occurs. trunk/pihlaja/src/pihlaja/core/scene.d
r9 r10 111 111 }*/ 112 112 113 this( Movie set_parent_movie, SceneChain set_scene_chain, double sx = 0.0, double sy = 0.0, double sw = 100.0, double sh = 100.0, String set_name = "Empty LinkableScene" )113 this( Movie set_parent_movie, SceneChain set_scene_chain, double sx = 0.0, double sy = 0.0, double sw = 200.0, double sh = 120.0, String set_name = "Empty LinkableScene" ) 114 114 { 115 115 super( sx, sy, sw, sh, set_name ); … … 673 673 return m_nextScene = set; 674 674 } 675 LinkableScene nextScene() { return m_nextScene; }676 677 p rotectedLinkableScene beforeScene(LinkableScene set)675 public LinkableScene nextScene() { return m_nextScene; } 676 677 public LinkableScene beforeScene(LinkableScene set) 678 678 { 679 679 //set.moveTo( x2, y ); … … 681 681 return m_beforeScene = set; 682 682 } 683 p rotectedLinkableScene beforeScene() { return m_beforeScene; }683 public LinkableScene beforeScene() { return m_beforeScene; } 684 684 685 685 /*class SceneChain … … 1090 1090 */ 1091 1091 public double sourceStart() { return m_sourceStart; } 1092 p rotecteddouble sourceStart( double set )1092 public double sourceStart( double set ) 1093 1093 { 1094 1094 m_sourceStart = set; … … 1464 1464 //The nextScene is positioned to the right of this scene, and it follows this 1465 1465 //scene unless SHIFT is pressed (then it will be removed from the chain). 1466 public bool isLinkNextScene( bool set ) { return m_isLinkNextScene = set; } 1466 1467 public bool isLinkNextScene() { return m_isLinkNextScene; } 1467 1468 protected bool m_isLinkNextScene = false; 1468 1469 protected LinkableScene m_nextScene; 1470 public bool isLinkBeforeScene( bool set ) { return m_isLinkBeforeScene = set; } 1469 1471 public bool isLinkBeforeScene() { return m_isLinkBeforeScene; } 1470 1472 protected bool m_isLinkBeforeScene = false; … … 1624 1626 scene_node.setAttribute( "w", w ); 1625 1627 scene_node.setAttribute( "h", h ); 1628 scene_node.setAttribute( "isLinkNextScene", isLinkNextScene() ); 1629 1626 1630 1627 1631 } … … 2017 2021 } 2018 2022 2019 this( Movie set_parent_movie, SceneChain set_scene_chain, double sx = 0.0, double sy = 0.0, double sw = 100.0, double sh = 100.0, String set_name = "Empty Scene" )2023 this( Movie set_parent_movie, SceneChain set_scene_chain, double sx = 0.0, double sy = 0.0, double sw = 200.0, double sh = 120.0, String set_name = "Empty Scene" ) 2020 2024 { 2021 2025 debug(3) writefln("Scene.this(...) START."); … … 2034 2038 } 2035 2039 */ 2040 2041 static Scene load003( Movie set_movie, SceneChain set_scene_chain, XmlNode xml_node ) 2042 { 2043 Scene empty = new Scene( set_movie, set_scene_chain, 2044 std.string.atof( xml_node.getAttribute( "x" ) ), 2045 std.string.atof( xml_node.getAttribute( "y" ) ), 2046 std.string.atof( xml_node.getAttribute( "w" ) ), 2047 std.string.atof( xml_node.getAttribute( "h" ) ), 2048 xml_node.getAttribute( "name" ) ); 2049 //xml_node.getAttribute( "filename" ), materialTypeFromString( xml_node.getAttribute( "materialType" ) ), std.string.atof( xml_node.getAttribute( "mediaDuration" )) ); 2050 //empty.name = ; 2051 //empty.x = ; 2052 char[] is_link_next_string = xml_node.getAttribute( "isLinkNextScene" ); 2053 if( is_link_next_string == "true" ) 2054 empty.isLinkNextScene = true; 2055 else if( is_link_next_string == "false" ) 2056 empty.isLinkNextScene = false; 2057 else writefln("Error while loading Scene. isLinkNextScene is neither true or false."); 2058 2059 /* 2060 XmlNode[] child_nodes = xml_node.getChildren(); 2061 2062 foreach( XmlNode ch_node; child_nodes ) 2063 { 2064 if( ch_node.getName() == "StartScene") 2065 { 2066 debug(loading) writefln("- Found StartScene."); 2067 //empty.pushBack( Scene.load003( set_movie, empty, ch_node ) ); 2068 } 2069 2070 if( ch_node.getName() == "Scene") 2071 { 2072 debug(loading) writefln("- Found Scene."); 2073 empty.pushBack( Scene.load003( set_movie, empty, ch_node ) ); 2074 } 2075 }*/ 2076 2077 return empty; 2078 2079 } 2080 2036 2081 void save003( XmlNode parent_node ) 2037 2082 { … … 2043 2088 scene_node.setAttribute( "w", w ); 2044 2089 scene_node.setAttribute( "h", h ); 2090 scene_node.setAttribute( "isLinkNextScene", isLinkNextScene() ); 2045 2091 2046 2092 foreach( Track tr; track ) trunk/pihlaja/src/pihlaja/core/scenechain.d
r9 r10 87 87 } 88 88 89 static SceneChain load003( Movie set_movie, XmlNode xml_node ) 90 { 91 SceneChain empty = new SceneChain( set_movie ); 92 //xml_node.getAttribute( "filename" ), materialTypeFromString( xml_node.getAttribute( "materialType" ) ), std.string.atof( xml_node.getAttribute( "mediaDuration" )) ); 93 94 XmlNode[] child_nodes = xml_node.getChildren(); 95 96 foreach( XmlNode ch_node; child_nodes ) 97 { 98 if( ch_node.getName() == "StartScene") 99 { 100 debug(loading) writefln("- Found StartScene."); 101 /* //empty.pushBack( Scene.load003( set_movie, empty, ch_node ) ); 102 103 StartScene str = set_movie.startScene(); 104 105 set_movie.startScene.x = std.string.atof( ch_node.getAttribute( "x" ) ); 106 set_movie.startScene.y = std.string.atof( ch_node.getAttribute( "y" ) ); 107 set_movie.startScene.w = std.string.atof( ch_node.getAttribute( "w" ) ); 108 set_movie.startScene.h = std.string.atof( ch_node.getAttribute( "h" ) ); 109 110 char[] is_link_next_string = ch_node.getAttribute( "isLinkNextScene" ); 111 if( is_link_next_string == "true" ) 112 set_movie.startScene.isLinkNextScene = true; 113 else if( is_link_next_string == "false" ) 114 set_movie.startScene.isLinkNextScene = false; 115 else writefln("Error while loading StartScene. isLinkNextScene is neither true or false."); 116 117 str.sceneChain.remove( str ); 118 empty.pushBack( str ); 119 */ 120 } 121 122 /*if( ch_node.getName() == "Scene") 123 { 124 debug(loading) writefln("- Found Scene."); 125 Scene scn = Scene.load003( set_movie, empty, ch_node ); 126 //empty.pushBack( scn ); 127 //set_movie.addScene( scn ); 128 }*/ 129 } 130 131 //empty.updateSceneChain(); 132 133 return empty; 134 135 } 136 89 137 void save003( XmlNode parent_node ) 90 138 { … … 97 145 scn.save003( scene_chain_node ); 98 146 } 147 148 } 149 150 /** 151 * updateSceneChain updates the linkedlist kind of 152 * structure (the nextScene and beforeScene members of each scene in the sceneChain list). 153 * This is called atleast after addToSceneChain. 154 */ 155 protected void updateSceneChain( bool select_this_scene = false ) 156 { 157 debug(SceneChain) writefln("SceneChain.updateSceneChain() START." ); 158 debug(SceneChain) scope(exit) writefln("SceneChain.updateSceneChain() END."); 159 160 LinkableScene bef = null; 161 LinkableScene first = first(); 162 debug(SceneChain) writefln("sceneChain.first.name: ", first.name() ); 163 double current_frame = 0.0; 164 165 //This will remove the current scene.gnlCompositions from the pipelinePlayer. 166 //and put our first scene there. Also "reallyselects" the first scene. 167 //CHECK: should this behaviour be optional... because of splitSceneChain calling updateSceneChain too. 168 //Now it's optional. 169 if( select_this_scene == true && movie !is null) 170 { 171 //CHANGED FROM movie.selectedScene = cast(LinkableScene) first; 172 //TO 173 movie.deselectAll(); 174 movie.setIsSelectedOne( cast(CanvasItem) first, true ); 175 } 176 177 foreach( LinkableScene item; this ) 178 { 179 if( bef !is null ) 180 { 181 debug(SceneChain) writefln("SceneChain.updateSceneChain() in the loop."); 182 183 item.sceneChain = this;//bef.sceneChain; 184 bef.nextScene = item; 185 item.beforeScene = bef; 186 187 if( bef.isLinkNextScene == false && item.isLinkBeforeScene == false ) 188 { 189 double item_delta_x = bef.x2 - item.x; 190 double item_delta_y = bef.cy - item.cy; 191 item.moveR( item_delta_x, item_delta_y ); 192 } 193 else if( bef.isLinkNextScene == true && item.isLinkBeforeScene == true ) 194 { 195 196 } 197 else if( bef.isLinkNextScene == true ) 198 { 199 item.isLinkBeforeScene = true; 200 } 201 else 202 { 203 writefln("Scene.updateSceneChain() Error: m_isLinkNextScene and m_isLinkBeforeScene don't match."); 204 } 205 206 } 207 bef = item; 208 209 debug(SceneChain) writefln("updateSceneChain() updating masterScene."); 210 211 //gstreamer/gnonlin part: 212 //This will put the gnlSources of all the scenes inside the ownGnlCompositions 213 //of the first scene in the sceneChain. 214 //(cast(LinkableScene) 215 item.masterScene( first ); 216 217 218 debug(SceneChain) writefln("updateSceneChain() updating sourceStart."); 219 //and this will change the sources starting positions so that they 220 //follow each other. 221 //(cast(LinkableScene) 222 item.sourceStart = current_frame; 223 224 debug(SceneChain) writefln("updateSceneChain() setting current_frame += item.duration."); 225 current_frame += item.duration(); 226 } 99 227 100 228 } trunk/pihlaja/src/pihlaja/core/track.d
r9 r10 232 232 (cast(Edit)it).fileSourceCopy().ref();//CHECK if this makes any sense gstreamer remove/ref. 233 233 (cast(Bin) m_gnlComposition).remove( (cast(Edit)it).fileSourceCopy() ); 234 234 235 235 } 236 236 trunk/pihlaja/src/pihlaja/pihlajamain.d
r9 r10 105 105 { 106 106 splashScreen.okToHide = true; 107 107 108 } 108 109 … … 118 119 } 119 120 120 ProjectWindow newProject( char[] name, char[] projectDir )121 ProjectWindow openProject( char[] name, char[] projectDir ) 121 122 { 122 123 debug(Project) writefln("Pihlaja.newProject() START."); … … 131 132 132 133 ProjectWindow empty = new ProjectWindow( this ); 134 //empty.load003( name, projectDir ); 133 135 empty.setNameAndProjectDir( name, projectDir ); 136 empty.load003(); 134 137 project.pushBack( empty ); 135 138 //selectedProject = empty; trunk/pihlaja/src/pihlaja/ui/materialstreeview.d
r8 r10 27 27 private import pihlaja.core.globals; 28 28 29 private import pihlaja.core.movie; 29 30 private import pihlaja.core.material; 30 31 … … 43 44 44 45 Image binImage; 46 Image movieImage; 45 47 Image materialImage; 46 48 //Pixbuf pixbuf; … … 77 79 newImageScaled( binImage, g_themeDir ~ "/icons/bin.png", -1, 18 ); 78 80 newImageScaled( materialImage, g_themeDir ~ "/icons/material.png", -1, 18 ); 81 newImageScaled( movieImage, g_themeDir ~ "/icons/movie.png", -1, 18 ); 79 82 80 83 //pixbuf = new Pixbuf(greenClass_xpm); … … 150 153 151 154 selectedBin = materialTreeStore.append( iterTop ); 155 } 156 157 void addMovie( Movie set_movie ) 158 { 159 debug(Discoverer) writefln("MaterialsTreeview.addMovie() Putting the movie to the bin.\n"); 160 //TreeIter iterTop = materialTreeStore.createIter(); 161 TreeIter iterChild; 162 163 iterChild = materialTreeStore.append( selectedBin ); 164 materialTreeStore.setValue( iterChild, 0, movieImage.getPixbuf() );//new Pixbuf( material_xpm) ); 165 materialTreeStore.setValue( iterChild, 1, set_movie.name() ); 152 166 } 153 167 trunk/pihlaja/src/pihlaja/ui/projectchooser.d
r8 r10 212 212 void onSkip( Button unused_button ) 213 213 { 214 hide(); 214 writefln("Currently skipping doesn't work."); 215 /*hide(); 215 216 216 217 char[] name = "Empty"; … … 220 221 writefln("name: ", name, " projectDir: ", projectDir ); 221 222 222 pihlaja.newProject( name, projectDir ); 223 pihlaja.newProject( name, projectDir );*/ 223 224 } 224 225 … … 227 228 hide(); 228 229 229 char[] name = projectChooserTreeView.getSelected(); 230 //NOTICE we don't allow spaces in the names for now. Because the xml 231 //implementation doesn't support it when loading. 232 char[] name = std.string.replace( projectChooserTreeView.getSelected(), " ", "_" ); 233 //Anyway it goes in the future, I don't want to allow spaces in filenames, 234 //so the spaces also get replaced to "_" in the directory name. 230 235 char[] projectDir = std.path.addExt( getAbsoluteDir( g_projectDir ~ std.path.sep ~ std.string.tolower( std.string.replace( name, " ", "_" ) ) ), "pihlaja" ); 231 236 232 237 writefln("name: ", name, " projectDir: ", projectDir ); 233 238 234 pihlaja. newProject( name, projectDir );239 pihlaja.openProject( name, projectDir ); 235 240 } 236 241 trunk/pihlaja/src/pihlaja/ui/projectwindow.d
r9 r10 114 114 115 115 window.addOnKeyPress( &onKeyPress ); 116 window.addOnRealize( &pihlaja.onWindowRealize ); 116 //window.addOnRealize( &pihlaja.onWindowRealize ); 117 window.addOnRealize( &onWindowRealize ); 117 118 118 119 debug(Pihlaja) writefln("Pihlaja.this() creating maingvbox."); … … 311 312 312 313 313 debug(Pihlaja) writefln("Pihlaja.this() adding monitorButtonsHBox to timelineVBox.");314 debug(Pihlaja) writefln("Pihlaja.this() adding timelineButtonsHBox to timelineVBox."); 314 315 timelineVBox.packStart( timelineButtonsHBox, false, false, 0 ); 315 316 316 timelineVBox.packStart( selectedMovie, true, true, 0);//false, 0);317 //timelineVBox.packStart( selectedMovie, true, true, 0);//false, 0); 317 318 318 319 debug(Pihlaja) writefln("Pihlaja.this() creating timeline_sliders_hbox."); … … 439 440 }*/ 440 441 442 void onWindowRealize( Widget unused_window ) 443 { 444 //load003(); //name, projectDir ); 445 } 446 447 void load003()// char[] set_name, char[] set_project_dir ) 448 { 449 //writefln("Trying to open project ", set_name, " from project directory: ", set_project_dir ); 450 451 //setNameAndProjectDir( set_name, set_project_dir ); 452 453 writefln("Trying to open project ", name, " from project directory: ", projectDir ); 454 455 if( std.file.exists( currentFilename ) == true ) 456 { 457 writefln("Current version exists. Trying to open it."); 458 std.stream.File file = new File( currentFilename, FileMode.In ); 459 super.load003( file ); 460 file.close(); 461 } 462 else 463 { 464 writefln("Project file doesn't exist. This is a new project."); 465 } 466 } 467 441 468 void save003() 442 469 { … … 474 501 if( std.file.exists( projectDir ) == true ) 475 502 { 503 if( std.file.exists( "current.pihlajaproject" ) == true ) 504 { 505 writefln("Current version exists."); 506 //currentVersionAdd(); 507 } 508 476 509 while( std.file.exists( currentVersionFilename ) == true ) 477 510 { … … 807 840 808 841 return true; 842 } 843 844 //overloaded from Project 845 void addMovieToBin( Movie set_movie ) 846 { 847 if( materialsTreeview !is null ) 848 materialsTreeview.addMovie( set_movie ); 849 } 850 851 public Movie selectedMovie() { return super.selectedMovie(); } 852 public Movie selectedMovie( Movie set ) 853 { 854 if( timelineVBox !is null && selectedMovie !is null ) 855 { 856 timelineVBox.remove( selectedMovie ); 857 } 858 super.selectedMovie( set ); 859 if( timelineVBox !is null ) 860 { 861 timelineVBox.packStart( selectedMovie, true, true, 0); 862 selectedMovie.show(); 863 } 864 return set; 809 865 } 810 866
