Copyright © 2001-2008 MultiMedia Soft 
Return to Table of contents  
 
Fader object 
 
The Fader object, accessible through the control's Fader property, is internally implemented as a COM interface called IFader and contains information needed to operate the embedded Automatic Fader
 
It can be used at Run-time in order to create and operate the embedded Fader and to access its Display property. For details about using the Automatic Fader refer to the How to use the Automatic Fader section. 
 
The Fader object is implemented through the following methods and properties: 
 
Methods 
 
  • Init 
  • Exit 
  • StartManualFading 
  •  
    Properties 
     
  • FadeInEnabled 
  • FadeOutEnabled 
  • FadeStartFromEnd 
  • FadeOutLength 
  • FadeInLength 
  • FadeInSeekPos 
  • FadeInDelayFromMixStart 
  • FadeOutDelayFromMixStart 
  • FadeOutMode 
  • Display 
  • TotalMixingTime 
  •  
    The following code snippets show how to initialise and change settings for this object in your code. These examples assume that you have placed a control named MyPlayer on a form or dialog and that you want to change a couple of Fader settings (fade-in duration set to 3000 milliseconds and fade-out duration set to 4000 milliseconds). 
  • Microsoft Visual C++ (4.0, 5.0 and 6.0) 
  • Microsoft Visual Basic (5.0 and 6.0) 
  • Microsoft Visual Basic.NET 
  • Microsoft Visual C#.NET 
  • Microsoft Visual J#.NET 
  •  
    Microsoft Visual C++ (4.0, 5.0 and 6.0) 
     
    Properties and methods of the control are accessible through the control wrapper class CAmp3dj contained inside the amp3dj.cpp and amp3dj.h files: these wrapper files are automatically generated when you insert the control inside your project so, in order to access the wrapper functions, you will have to insert the following line of code somewhere in your code. 
     
    #include "amp3dj.h" 
     
    The Fader object is defined by the control wrapper class CFader contained inside the fader.cpp and fader.h files: also these wrapper files are automatically generated when you insert the control inside your project so, in order to access this object, you will have to insert the following line of code somewhere in your code. 
     
    #include "fader.h" 
     
    Here follows the code needed to perform the requested operation of initialising the Fader object and changing some of its properties. 
     
    // declare a Fader object 
    CFader fader; 
     
    // init the object with the control's Fader reference 
    fader = MyPlayer.GetFader (); 
     
    // initialise the Fader on player 0 and player 1 
    fader.Init (FADE_SINGLE, 0, 1); 
     
    // set the fade-in and fade-out duration 
    fader.SetFadeInLength (3000); 
    fader.SetFadeOutLength (4000); 
     
    As you can see the access to the Fader properties FadeInLength and FadeOutLength are wrapped by the SetFadeInLength and SetFadeOutLength functions declared inside the wrapper class CFader. 
    Note that the use of the FADE_SINGLE enumerated type requires to add the following include to your code: 
    #include "AdjMmsEngDef.h" 
     
    Microsoft Visual Basic (5.0 and 6.0) 
     
    Here follows the code needed to perform the requested operations 
     
    ' initialise the Fader 
    MyPlayer.Fader.Init 0, 0, 1 
     
    ' set the fade-in and fade-out duration 
    MyPlayer.Fader.FadeInLength = 3000 
    MyPlayer.Fader.FadeOutLength = 4000 
     
    Microsoft Visual Basic.NET 
     
    Here follows the code needed to perform the requested operations 
     
    ' initialise the Fader on player 0 and player 1 
    MyPlayer.Fader.Init (enumFadeTypes.FADE_SINGLE, 0, 1) 
     
    ' set the fade-in and fade-out duration 
    MyPlayer.Fader.FadeInLength = 3000 
    MyPlayer.Fader.FadeOutLength = 4000 
     
    Microsoft Visual C#.NET 
     
    Here follows the code needed to perform the requested operations 
     
    // initialise the Fader on player 0 and player 1 
    MyPlayer.Fader.Init (enumFadeTypes.FADE_SINGLE, 0, 1); 
     
    // set the fade-in and fade-out duration 
    MyPlayer.Fader.FadeInLength = 3000; 
    MyPlayer.Fader.FadeOutLength = 4000; 
     
    Microsoft Visual J#.NET 
     
    Here follows the code needed to perform the requested operations 
     
    // initialise the Fader 
    MyPlayer.get_Fader().Init (AMP3DJLib.enumFadeTypes.FADE_SINGLE, (short) 0, (short) 1); 
     
    // set the fade-in and fade-out duration 
    MyPlayer.get_Fader().set_FadeInLength (3000); 
    MyPlayer.get_Fader().set_FadeOutLength (4000); 
     
    As you can see, in J#.NET the access to the control properties is made through the use of wrapper functions (automatically generated when you insert the control inside your project) with the "get_" and "set_" prefixes. Intellisense will help you finding the right wrapper function. 
     
     
     
     
     
     
     
     
    Copyright © 2001-2008 MultiMedia Soft 
    Return to Table of contents