Example #1
0
 public static void current_time( ClassNativeSound sound, double new_time )
 {
     WP7Sound sound_data = sound.property_native_data as WP7Sound;
       if (sound_data != null) sound_data.set_current_time( new_time );
 }
Example #2
0
 public static double current_time( ClassNativeSound sound )
 {
     WP7Sound sound_data = sound.property_native_data as WP7Sound;
       if (sound_data != null) return sound_data.get_current_time();
       return 0.0;
 }
Example #3
0
 public static void repeats( ClassNativeSound sound, bool setting )
 {
     WP7Sound sound_data = sound.property_native_data as WP7Sound;
       if (sound_data != null) sound_data.set_repeats( setting );
 }
Example #4
0
 public static ClassNativeSound create_duplicate( ClassNativeSound sound )
 {
     return sound;
 }
Example #5
0
 public static void pitch( ClassNativeSound sound, double new_pitch )
 {
     WP7Sound sound_data = sound.property_native_data as WP7Sound;
       if (sound_data != null) sound_data.set_pitch( new_pitch - 1.0 );
 }
Example #6
0
 public static void play( ClassNativeSound sound )
 {
     WP7Sound sound_data = sound.property_native_data as WP7Sound;
       if (sound_data != null) sound_data.play();
 }
Example #7
0
 public static void pan( ClassNativeSound sound, double new_pan )
 {
     WP7Sound sound_data = sound.property_native_data as WP7Sound;
       if (sound_data != null) sound_data.set_pan( new_pan );
 }
Example #8
0
 public static bool is_playing( ClassNativeSound sound )
 {
     WP7Sound sound_data = sound.property_native_data as WP7Sound;
       if (sound_data != null) return sound_data.is_playing();
       return false;
 }
Example #9
0
 public static void init( ClassNativeSound sound, ClassArrayList_of_Byte raw_bytes )
 {
     Bard.log("TODO: NativeNativeSound::init(raw_bytes)");
 }
Example #10
0
        public static void init( ClassNativeSound sound, ClassString filename )
        {
            String fname = filename.data;
              if (fname.EndsWith(".wav") || fname.EndsWith(".mp3") || fname.EndsWith(".m4a"))
              {
            fname = fname.Substring( 0, fname.Length - 4);
              }

              WP7Sound sound_data = null;
              try
              {
            sound_data = new WP7SoundEffect(
              Plasmacore.content.Load<SoundEffect>(fname) );
              }
              catch (Exception)
              {
            try
            {
              sound_data = new WP7Song( Plasmacore.content.Load<Song>(fname) );
            }
            catch (Exception)
            {
              Bard.log( "Sound not found: " + filename.data );
              return;
            }
              }
              sound.property_native_data = sound_data;
        }
Example #11
0
 public static double duration( ClassNativeSound sound )
 {
     WP7Sound sound_data = sound.property_native_data as WP7Sound;
       if (sound_data != null) return sound_data.get_duration();
       return 0.0;
 }