Exemple #1
0
        public void Convert()
        {
            iTunesAppClass       itunes     = new iTunesAppClass();
            IITEncoderCollection encoders   = itunes.Encoders;
            IITEncoder           mp3Encoder = null;

            foreach (IITEncoder encoder in encoders)
            {
                Console.WriteLine(String.Format(
                                      "Encoder: [{0}] format=[{1}]", encoder.Name, encoder.Format));

                if (encoder.Format.Equals("MP3"))
                {
                    mp3Encoder = encoder;
                }
            }

            if (mp3Encoder != null)
            {
                object track = itunes.LibraryPlaylist.Tracks.get_ItemByName("A Horse with No Name");
                itunes.CurrentEncoder = mp3Encoder;
                iTunesConvertOperationStatus status = itunes.ConvertTrack2(ref track);

                status.OnConvertOperationCompleteEvent +=
                    new _IITConvertOperationStatusEvents_OnConvertOperationCompleteEventEventHandler(
                        status_OnConvertOperationCompleteEvent);

                status.OnConvertOperationStatusChangedEvent +=
                    new _IITConvertOperationStatusEvents_OnConvertOperationStatusChangedEventEventHandler(
                        status_OnConvertOperationStatusChangedEvent);

                reset = new ManualResetEvent(false);
                reset.WaitOne();
            }
        }
Exemple #2
0
        /// <summary>
        /// Interaction.Cleanup override; release reference to internal encoder.
        /// </summary>

        protected override void Cleanup(bool finalRelease)
        {
            if (finalRelease)
            {
                Release(encoder);
                encoder = null;
            }
        }
Exemple #3
0
 /// <summary>
 /// Initialize a new instance that wraps the given iTunes encoder COM object.
 /// </summary>
 /// <param name="encoder">An IITEncoder instance.</param>
 public Encoder(IITEncoder encoder)
     : base()
 {
     this.encoder = encoder;
     if (encoder == null)
     {
         this.format = "?";
         this.name = Resx.EncoderNone.ToLower();
     }
     else
     {
         this.format = encoder.Format;
         this.name = encoder.Name;
     }
 }
Exemple #4
0
 /// <summary>
 /// Initialize a new instance that wraps the given iTunes encoder COM object.
 /// </summary>
 /// <param name="encoder">An IITEncoder instance.</param>
 public Encoder(IITEncoder encoder)
     : base()
 {
     this.encoder = encoder;
     if (encoder == null)
     {
         this.format = "?";
         this.name = "no encoding";
     }
     else
     {
         this.format = encoder.Format;
         this.name = encoder.Name;
     }
 }
Exemple #5
0
        /// <summary>
        /// Initialize a new instance that wraps the given iTunes encoder COM object.
        /// </summary>
        /// <param name="encoder">An IITEncoder instance.</param>

        public Encoder(IITEncoder encoder)
            : base()
        {
            this.encoder = encoder;
            if (encoder == null)
            {
                this.format = "?";
                this.name   = "no encoding";
            }
            else
            {
                this.format = encoder.Format;
                this.name   = encoder.Name;
            }
        }
Exemple #6
0
        /// <summary>
        /// Initialize a new instance that wraps the given iTunes encoder COM object.
        /// </summary>
        /// <param name="encoder">An IITEncoder instance.</param>

        public Encoder(IITEncoder encoder)
            : base()
        {
            this.encoder = encoder;
            if (encoder == null)
            {
                this.format = "?";
                this.name   = Resx.EncoderNone.ToLower();
            }
            else
            {
                this.format = encoder.Format;
                this.name   = encoder.Name;
            }
        }
Exemple #7
0
        private void AllProps(iTunesAppClass itunes)
        {
            bool                  acmpEnabled = itunes.AppCommandMessageProcessingEnabled;
            IITEncoder            encoder     = itunes.CurrentEncoder;
            IITEQPreset           eqPreset    = itunes.CurrentEQPreset;
            IITPlaylist           playlist    = itunes.CurrentPlaylist;
            string                streamTitle = itunes.CurrentStreamTitle;
            string                streamURL   = itunes.CurrentStreamURL;
            IITTrack              track       = itunes.CurrentTrack;
            IITVisual             visual      = itunes.CurrentVisual;
            IITEncoderCollection  encoders    = itunes.Encoders;
            bool                  eqEnabled   = itunes.EQEnabled;
            IITEQPresetCollection eqPresets   = itunes.EQPresets;

            // this always seems to raise a COM exception, whether playing or stopped...
            //IITWindow eqWindow = itunes.EQWindow;

            bool fgOnDialog = itunes.ForceToForegroundOnDialog;
            bool fsVisuals  = itunes.FullScreenVisuals;
            IITLibraryPlaylist libPlaylist = itunes.LibraryPlaylist;
            IITSource          libSource   = itunes.LibrarySource;
            string             libXmlPath  = itunes.LibraryXMLPath;
            bool mute = itunes.Mute;

            // this will raise a COM exception when iTunes first started
            //int position = itunes.PlayerPosition;

            ITPlayerState      state          = itunes.PlayerState;
            IITTrackCollection selectedTracks = itunes.SelectedTracks;
            int  volume                        = itunes.SoundVolume;
            bool volEnabled                    = itunes.SoundVolumeControlEnabled;
            IITSourceCollection sources        = itunes.Sources;
            string version                     = itunes.Version;
            IITVisualCollection visuals        = itunes.Visuals;
            bool                visualsEnabled = itunes.VisualsEnabled;
            ITVisualSize        visualSize     = itunes.VisualSize;
            IITWindowCollection windows        = itunes.Windows;
        }
Exemple #8
0
 /// <summary>
 /// Interaction.Cleanup override; release reference to internal encoder.
 /// </summary>
 protected override void Cleanup(bool finalRelease)
 {
     if (finalRelease)
     {
         Release(encoder);
         encoder = null;
     }
 }
Exemple #9
0
 /// <summary>
 /// Interaction.Cleanup override; release reference to internal encoder.
 /// </summary>
 protected override void Cleanup()
 {
     Release(encoder);
     encoder = null;
 }
Exemple #10
0
        /// <summary>
        /// Interaction.Cleanup override; release reference to internal encoder.
        /// </summary>

        protected override void Cleanup()
        {
            Release(encoder);
            encoder = null;
        }