InitialObjectDescriptor {
 objectDescriptorID 1
 audioProfileLevelIndication 255
 visualProfileLevelIndication 254
 sceneProfileLevelIndication 1
 graphicsProfileLevelIndication 1
 ODProfileLevelIndication 1
 esDescr [
  ES_Descriptor {
   ES_ID 1
   decConfigDescr DecoderConfigDescriptor {
    streamType 3
    decSpecificInfo BIFSConfig {
     isCommandStream true
     pixelMetric true
     pixelWidth 300
     pixelHeight 300
    }
   }
  }
  ES_Descriptor {
   ES_ID 2
   decConfigDescr DecoderConfigDescriptor {
    streamType 1
   }
  }
 ]
}

PROTO AudioControler [
	exposedField MFString the_url []
	exposedField MFString comment []
	exposedField SFVec2f position 0 0
	exposedField SFColor color 0 0 0
	exposedField SFFloat vol 1.0
	exposedField SFInt32 numChannels 2
] {
	Transform2D {
		translation IS position
		children [
			Transform2D {
				children [
					Shape {
						appearance Appearance { material Material2D {emissiveColor IS color filled TRUE} }
						geometry Rectangle { size 200 20 }
					}
					DEF TS TouchSensor {}
				]
			}
			Transform2D {
				translation -120 0
				children [
					Shape {
						appearance DEF TXTAPP Appearance { material DEF MAT Material2D {emissiveColor 0 0 0 filled TRUE} }
						geometry DEF TXT Text { string ["volume", "0"] fontStyle DEF FS FontStyle { size 12 justify ["MIDDLE"]} }
					}
					
				]
			}
			Transform2D {
				translation 0 20
				children [
					Shape {
						appearance USE TXTAPP
						geometry Text { string IS comment fontStyle USE FS}
					}
					
				]
			}
		  DEF SND Sound2D {
  		 intensity IS vol
		   source AudioSource {
		    url IS the_url
		    startTime 0
		    numChan IS numChannels
		   }
		  }
		  MediaControl {
		   url IS the_url
		   loop TRUE
		  }
		]
	}
  DEF SC Script {
   eventIn SFVec3f set_frac
   eventIn SFBool set_down
   field SFNode s USE SND
   field SFNode t USE TXT
   field SFBool isDown FALSE
   url ["javascript:
   	function initialize() {
   		t.string[1] = '' + s.intensity;
   	}
   	function set_down(value, timestamp) {isDown = value;}
   	function set_frac(value, timestamp) {
   		if (!isDown) return;
   		pos = (value.x + 100)/200;
   		s.intensity = pos;
   		t.string[1] = '' + pos;
   	}
   	"
   	]
  }
	ROUTE TS.isActive TO SC.set_down
	ROUTE TS.hitPoint_changed TO SC.set_frac
	
}

OrderedGroup {
 children [
  Background2D {
   backColor 1 1 1
  }
  WorldInfo {
   info ["This shows MediaControl" "controling audio playback speed" "" "GPAC Regression Tests" "$Date: 2007-07-27 09:46:10 $ - $Revision: 1.3 $" "(C) 2002-2004 GPAC Team"]
   title "Media Control Test"
  }

	AudioControler {
		position 0 100
		color 1 0 0
		the_url ["od:10"]
	  numChannels 2
	  vol 1
	  comment ["Audio #1 - running on its own timeline"]
  }
	AudioControler {
		position 0 33
		color 0 1 0
		the_url ["od:11"]
	  numChannels 2
	  vol 0
	  comment ["Audio #2 - running on its own timeline"]
  }
	AudioControler {
		position 0 -33
		color 0 0 1
		the_url ["od:11"]
	  numChannels 2
	  vol 0
	  comment ["Audio #3 reusing Audio #2 object"]
  }
	AudioControler {
		position 0 -100
		color 1 0 1
		the_url ["od:12"]
	  numChannels 2
	  vol 0
	  comment ["Audio #4 - running on Audio #2 timeline"]
  }
 ]
}

AT 0 {
  UPDATE OD [
   ObjectDescriptor {
    objectDescriptorID 10
    esDescr [
     ES_Descriptor {
      ES_ID 10
      OCR_ES_ID 10
      muxInfo MuxInfo {
       fileName "../auxiliary_files/count_english.mp3"
      }
     }
    ]
   }
   ObjectDescriptor {
    objectDescriptorID 11
    esDescr [
     ES_Descriptor {
      ES_ID 11
      OCR_ES_ID 11
      muxInfo MuxInfo {
       fileName "../auxiliary_files/count_english.mp3"
      }
     }
    ]
   }
   ObjectDescriptor {
    objectDescriptorID 12
    esDescr [
     ES_Descriptor {
      ES_ID 12
      OCR_ES_ID 11
      muxInfo MuxInfo {
       fileName "../auxiliary_files/count_english.mp3"
      }
     }
    ]
   }
  ]
}

