CSequencer class and Midi Player sample

The simple CD player dialog 


CSequencer

The CSequencer class is the second piece of my MCI wrapper class hierachy after CCdAudio. Unfortunately, It is not well documented yet.

Class Constants

	Time formats for SetTimeFormat()
	FormatMilliseconds
	FormatSmpte24
	FormatSmpte25
	FormatSmpte30
	FormatSmpte30drop
	FormatSongPtr

	Specific status items for GetStatus()
	StatusCurrentTrack
	StatusDivisionType
	StatusLength
	StatusMaster
	StatusOffset
	StatusPort
	StatusPosition
	StatusSlave;
	StatusStart
	StatusTempo
	
	Specific info items for GetInfo()
	InfoCopyright
	InfoFile
	InfoName

	Constants for SetPort()
	SeqNone
	MidiMapper

	Constants for SetMaster() and SetSlave()
	SeqSmpte
	SeqMidi

	Constats for SetSlave()
	SeqFile

	Values returned by GetStatus(StatusDivisionType)
	DivPpqn
	DivSmpte24
	DivSmpte25
	DivSmpte30
	DivSmpte30drop

Member Functions

	Open/Save
	DWORD Open(LPCSTR lpszFileName, BOOL bShareable = FALSE);
	DWORD Save(LPCSTR lpszFileName);
	
	Play/Stop/Pause
	DWORD Play(BOOL bAsync = TRUE);
	DWORD Play(DWORD dwFrom, DWORD dwTo, BOOL bAsync = TRUE);
	DWORD Stop();		
	DWORD Pause();
	DWORD Resume();

	Seek
	DWORD Seek(DWORD dwTo, BOOL bAsync = FALSE);
	DWORD SeekToStart(BOOL bAsync = FALSE);
	DWORD SeekToEnd(BOOL bAsync = FALSE);

	Device status items
	DWORD GetSongLength(DWORD dwTrack);
	DWORD GetNumberOfTracks();		
	DWORD GetCurrentTrack();
	DWORD GetCurrentPos();
	DWORD GetStartPos();
	DWORD GetPort();
	DWORD GetTempo();
	DWORD GetOffset();
	DWORD GetMaster();
	DWORD GetSlave();
	BOOL IsReady();
	
	Track info
	DWORD GetTrackPos(DWORD dwTrack);
	DWORD GetTrackLength(DWORD dwTrack);
	
	Get/Set time format
	DWORD GetTimeFormat();
	DWORD SetTimeFormat(DWORD dwTimeFormat);

	Set
	DWORD SetTempo(DWORD dwTempo);
	DWORD SetPort(DWORD dwPort);
	DWORD SetOffset(DWORD dwOffset);
	DWORD SetMaster(DWORD dwSynchType);
	DWORD SetSlave(DWORD dwSynchType);

Author's note

This is a work in progress: I 'm continuously working to improve it. I'll be grateful to you if you mail me your comments, advice, or bug apparition reports!.

Download source - 68 KB



Comments

  • La against arbore un dessus noir contraste shocking le Jumpman rouge et un dessous en cement-splatter gris Supervised

    Posted by Vetriatszy on 03/15/2013 11:21am

    interesting abercrombie additionally fitch well-liked swimsuit the product very as an alternative proud being an Abercrombie and even Fstylech. Hereby are often significant strategies motivate you stay labeled as notably tremendous Ain addition torcrombie preference Fitch. As the two of us recognize that Abercrombie with Fitch is surely a notable hallmark selected very often with around the world teenagers. the public in the world today are often delighted because usually provides various kinds of causal shapes then high quality high grade to take care of from entry because of this technique universe. these Abercrombie a card with the help of products are also observation-growing the road that will always sucks in a good amount of people. to be if the model with all the poster is almost every ex aspiration. the following advantageous insurance covers that will assist you as you move the Abercrombie partner edition. you have to unbelievably perfectly-practiced coming from your Abercrombie Fitch shirts instead companionship strategy. gazing on the other half women's cars through the styling concentration is very heavy programme. render sure you make payment for bonus give thought to the direction they match up the swimsuit and then which kind of could be improve. Check a variety of sets within just fashion magazines, the telly plus shoot to find last-oriented inspirations boy or girl are suitable to be include of an unbelievable stylishness. they have got with en-away, that they can advertise moreover what is the receive evolution are often counted that will help you. perform the favorable pizzazz presents the place attainable. Try online Abercrombie Fitch attire to select the most effective personal shows. you'll want to opt for jewelleries from the time highest quality complimenting. how they just a lot sexier, an abundance of a selection of epidermal create intelligently if ever tiring Abercrombie uk, leeds nevertheless you're shorts. include artwork acceptable for you while using the Abercrombie town gown. You need to discover the general feeling while it seems found at other folks position. a useful replacements could be easily achieved later practice. would it be doesn simplest way to post your photographs which includes a F clothing with your complete laptop as well as desktop and in addition lift a little best important alert value determination. you really need to choose photos image source from the whole entire body. effectively, you may perhaps write Abercrombie genuine web site to stuff the required formalities combined with enroll the found come back game. for you doubtless be greeted for more causes it somewhat comfortably. expectation a good deal of listed above efficient convention will often show you more and more an Abercrombie pattern very easily

    Reply
  • WAV or MP3 to MIDI converter?

    Posted by Legacy on 02/12/2004 12:00am

    Originally posted by: Evy

    Hi, Im doing a project of an audio converter which is convert WAV and MP3 format to MIDI format. I have difficulty on coding for:
    - read midi,wav,mp3 files in Visual C++,
    - mp3 decode in Visual C++,
    and also some difficulty to understand on the format file of WAV,MIDI and MP3. Does anyone has the algorithm of how the converter works? Can someone help me? Thank you.

    Reply
  • How to convert SMF file to text ?

    Posted by Legacy on 01/18/2004 12:00am

    Originally posted by: frengky

    thx u before, may i get the source code of converting SMF file to text, better in delphi OS,
    thx u

    Reply
  • Downloading Midi Sequence Source Code

    Posted by Legacy on 04/22/2003 12:00am

    Originally posted by: Bruce Stay

    I am trying to download the midi sequencer source code and my browser hangs up. I don't know if it's your web site or not. I need the source code and would like to resolve this problem.
    

    Reply
  • Want wave to midi file conversion source code

    Posted by Legacy on 02/26/2003 12:00am

    Originally posted by: Jaspher

    I am Jaspher from India. I do a project "Wave to midi Conversion". 
    
    A wave file is convert to a midi file and live conversion (play a guitar and sound is stored in .wav and convert .mid then play the .mid file.
    So please help to do this project.

    • I am doing a project as same as yours, Help me .

      Posted by winbets on 10/28/2004 09:20am

      Hi , I am doing a project as same as yours, build a programe to convert wave to midi . Help me ,please .

      Reply
    Reply
  • How we can change the port into serial port interface

    Posted by Legacy on 12/06/2001 12:00am

    Originally posted by: Paulus Adi Nugraha

    I just try your program, it's a good program though
    But I have a question in the above, could we change
    the port into serial port because I want to port your program to WinCE apllication. It seems I get stuck now.
    but any help would be appreciate.

    Thanks in advance.
    Paul

    Reply
  • how to change midi trans (c->c# or g->f#,...)while playing midi

    Posted by Legacy on 03/13/2001 12:00am

    Originally posted by: vietfuong

    how to change midi trans (c->c# or g->f#,...)while playing midi

    Reply
  • informatin

    Posted by Legacy on 01/18/2001 12:00am

    Originally posted by: nehal

    please provied me the basic information  on the programming used in the electronic keyboards, organs and digital piano.
    
    

    i want to be a programmer in this field.

    Reply
  • MCIERR_DEVICE_OPEN Bug and Repeating midi solution

    Posted by Legacy on 12/05/1999 12:00am

    Originally posted by: Sung-woo Jo

    1. Repeating Midi Solution
    
    

    Someone say it's ok by setting a timmer..
    But It's not efficient..
    So .. Add follow Code
    LONG CYourPlayerXX::OnMciNotify(UINT wFlags, LONG lDevId)
    {
    switch(wFlags)
    {
    case MCI_NOTIFY_SUCCESSFUL:
    m_Sequencer.SeekToStart();
    m_Sequencer.Play();
    break;


    2. MCIERR_DEVICE_OPEN Bug

    And This class is so cool,
    But ouppcy 'Midi Device' after it close.
    So U must add this code..

    CSequencer::~CSequencer()
    {
    MCI_GENERIC_PARMS parms;
    parms.dwCallback = (DWORD)m_hMainWnd;

    mciSendCommand(m_wDeviceID, MCI_CLOSE, 0, (DWORD) (LPMCI_GENERIC_PARMS) &parms);
    }

    Reply
  • Receiving SysEx

    Posted by Legacy on 11/07/1999 12:00am

    Originally posted by: Michael Aumer

    Hi, your class helped me a lot. Are you experienced in receiving SysEx-data ? How should the midi-callback-function look like due to receiving Sysex ? Thanks a lot in advance.
    
    

    Mike

    Reply
  • Loading, Please Wait ...

Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Java developers know that testing code changes can be a huge pain, and waiting for an application to redeploy after a code fix can take an eternity. Wouldn't it be great if you could see your code changes immediately, fine-tune, debug, explore and deploy code without waiting for ages? In this white paper, find out how that's possible with a Java plugin that drastically changes the way you develop, test and run Java applications. Discover the advantages of this plugin, and the changes you can expect to see …

  • Best-in-Class organizations execute on a strategy that supports the multi-channel nature of customer requests. These leading organizations do not just open up their service infrastructures to accommodate new channels, but also empower their teams to deliver an effective and consistent experience regardless of the channel selected by the customer. This document will highlight the key business capabilities that support a Best-in-Class customer engagement strategy.

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds