Changeset 1884
- Timestamp:
- 2006-01-26 20:24:15 (3 years ago)
- Files:
-
- Anode/trunk/acidfree/class_anode.inc (modified) (5 diffs)
- Anode/trunk/acidfree/output_annodex.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
Anode/trunk/acidfree/class_anode.inc
r1883 r1884 54 54 55 55 //FIXME files stored with missing extension. Dunno why. 56 $node->large = acidfree_add_file($node, $file->filepath, "{$node->nid}_large. {$node->media_ext}", $node->mime, false);56 $node->large = acidfree_add_file($node, $file->filepath, "{$node->nid}_large.ogg", $node->mime, TRUE); 57 57 58 58 $node->small = $node->large; // For now there's no distinction between … … 65 65 // passes to other methods. 66 66 67 $media_location = _acidfree_filemanager_url($node->large,true); 67 $media_location = _acidfree_get_path($node->large,true); 68 $output_anx_location = __FILE__."/../output_annodex.php"; 68 69 $anx_stub = '<?php 69 require_once(" ../../../modules/output_annodex.php");70 output_annodex( "'.$media_location.'" ) ';70 require_once("'.$output_anx_location.'"); 71 output_annodex( "'.$media_location.'" );'; 71 72 //FIXME this kind of path hardcoding can't be good. 72 73 … … 75 76 fwrite( $anx_stub_handle, $anx_stub ); 76 77 fclose( $anx_stub_handle ); 77 $anx_handler = acidfree_add_file($node, $anx_stub_name, "{$node->nid}_anx_ handler.php", $node->mime, true);78 $anx_handler = acidfree_add_file($node, $anx_stub_name, "{$node->nid}_anx_server.php", $node->mime, true); 78 79 79 80 //FIXME maybe just define the node id? 80 81 $cmml_stub = '<?php 81 82 require_once("../../../modules/output_annodex.php"); 82 output_cmml( "'.$media_location.'" ) ';83 output_cmml( "'.$media_location.'" );'; 83 84 //FIXME this kind of path hardcoding can't be good. 84 85 … … 93 94 db_query("INSERT INTO {acidfree_annodex}(nid, cmml_handler, annodex_handler) VALUES({$node->nid}, {$cmml_handler->fid}, {$anx_handler->fid});"); 94 95 95 if ($file->source != 'acidfree_local_filesystem') {96 file_delete($file->filepath);97 }96 //if ($file->source != 'acidfree_local_filesystem') { 97 // file_delete($file->filepath); 98 //} 98 99 } 99 100 … … 168 169 $output .= "<a href='$cmml'>view CMML</a><br/>"; 169 170 171 $output .= var_export( $node ); 172 170 173 return $output; 171 174 } Anode/trunk/acidfree/output_annodex.php
r1883 r1884 1 1 <?php 2 2 3 /* This file is to be used to output Annodex to a browser. It should be 4 * included into a php file that does nothing but define '$media_file'. 3 /* This file is to be used to output Annodex to a browser. 5 4 */ 6 5 7 6 require_once("phpannodex/AnnodexWriter.php"); 7 //require_once("acidfree.module"); 8 8 9 9 function output_annodex( $media_file, $output_headers=TRUE ) { 10 11 //$media_file = _acidfree_filemanager_url($node_large, TRUE); 12 10 13 $anx = new AnnodexWriter(); 11 $anx->import($media_file, NULL,NULL,0,-1);14 $anx->import($media_file, NULL, NULL, 0, -1); 12 15 16 output_annodex_headers( $anx ); 17 13 18 while( $buffer = $anx->write_output() ) { 14 19 echo $buffer; … … 21 26 function output_cmml( $cmml_file, $output_headers=TRUE ) { 22 27 23 echo "This is pretty CMML"; 28 header("Content-Type: application/x-annodex"); 29 header(""); 30 31 echo "<cmml>This is cmml</cmml>"; 32 24 33 return; 34 } 35 36 function make_preamble() { 37 $preamble = '<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE cmml SYSTEM "cmml.dtd">'; 38 return $preamble; 39 } 40 41 function make_clip( $a, $img, $description, $start, $end ) { 42 43 $clip .= "<clip"; 44 45 if( $a ) { 46 $clip .= 'a="$a" '; 47 } 48 if( $img ) { 49 $clip .= 'img="$a" '; 50 } 51 if( $description ) { 52 $clip .= 'desc="$a" '; 53 } 54 if( $start ) { 55 $clip .= 'start="$a" '; 56 } 57 if( $end ) { 58 $clip .= 'end="$a" '; 59 } 60 61 $clip .= "/>"; 62 63 return $clip; 25 64 } 26 65 … … 31 70 32 71 function output_annodex_headers( AnnodexWriter $anx ) { 33 72 73 header("Content-Type: application/x-annodex"); 74 header("X-Content-Bitrate-Average: {$anx->get_bitrate()}"); 75 header("X-Content_Duration: {$anx->get_duration()}"); 76 header(""); 77 34 78 return; 35 79 }