CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2010
    Posts
    2

    Complete C++ novice :(

    Hi there people, i'm new to the forums, and c++ so hi all

    First of all, sorry if this is the wrong place to put this, but it looked the most appropriate.

    Basically, I got this beast of an assignment for uni, and I have no idea what I'm doing in it as I've never done programming of any description (save for a bit of HTML for Myspace lol).

    The brief we have is :

    Your task is to create a console based “Audio & Video Sequencer” application
    for this assignment. The “Audio & Video Sequencer” should have a fixed playlist
    of one video track and three separate audio tracks. The video track should be a
    minimum duration of one minute and a maximum of three minutes. It should also
    have no audio content. The duration of the three audio tracks should add up to be
    the same as the duration of the video track. (Distinctly different audio tracks will
    work best. Suitable transitions will be expected.)

    When the user selects play the video track should be played and whilst playing the
    four audio tracks should be played, one after the other. Prior to playing the user
    should be able to select a specific sequence for the audio tracks to played in. If
    not the audio tracks should be played in a “default” order. The “Audio & Video
    Sequencer” should also have a “shuffle” function that allows the audio tracks to be
    played in a random order. It should also have a “loop” function so that the
    sequence can be repeated continually.

    Now, i have got the video playing, and the audio [using mciSendString]. However I have no idea how to go about making it so that you can choose an order, or to shuffle or whatever. My "tutor" [useless] decided to add loads of code to it [i.e. the "break", "switch" and the track info]. This confused the **** out of me because he told me to add stuff to it, and didn't explain what he did...

    The code i have so far:

    [quote]
    #include <iostream>
    #include <windows.h>
    #include <MMSystem.h>
    #pragma comment(lib, "winmm.lib")
    using namespace std;

    void play (void);
    void stop (void);

    int main () // start of program
    {
    int track1, track2, track3, track4;
    char answer;

    track1 = 1;
    track2 = 2;
    track3 = 3;
    track4 = 4;

    do
    {
    cout << "This audio and video sequencer will play a video file whilst playing a series of three consecutive audio files. There is a shuffle feature available, and the files can be continuously looped if desired.\n\n"; // display what program will do
    cout << "The video that will play is a collection of skateboarding accidents\n\n";
    cout << "The tracks that will be played are: \n 1) 'Bad Religion - You'\n 2) 'Rancid - Stickin In My Eye'\n 3) 'Marilyn Manson - The Beautiful People'\n\n"; // display tracklist
    cout << "Do you want to change the order of the playlist? [If you don't, the tracks will play in the default order]\n\n";

    cout<<" Please press 'P' to play\n\n Please press 'S' for a shuffle feature\n\n Please press 'D' for default order\n\n Please press 'Q' to quit\n\n";

    cin>>answer;

    switch (answer)
    {
    case 'S':
    case 's':
    // do shuffle code
    break;

    case 'D':
    case 'd':
    track1 = 1;
    track2 = 2;
    track3 = 3;
    track4 = 4;
    // default order code
    break;

    case 'C':
    case 'c':
    track1 = 1;
    track2 = 2;
    track3 = 3;
    track4 = 4;
    // choose order code
    break;

    case 'P':
    case 'p':
    play(track1);
    play(track2);
    play(track3);
    play(track4);
    //play code
    break;
    }
    }
    while (answer != 'Q' && answer != 'q'); // quit code

    fflush (stdin); // removes excess from the keyboard buffer
    cin.get ();// signifies program will wait for response before executing

    return 0; // ends program
    }

    void play(int track)
    {
    switch (track)
    {
    case 1:
    mciSendString (L"play H:\\Desktop\\Movie.wmv", NULL, 0, 0); // play Skate Bails Video
    break;
    case 2:
    mciSendString (L"play H:\\Desktop\\You.mp3 wait", NULL, 0, 0); // play Bad Religion
    break;
    case 3:
    mciSendString (L"play H:\\desktop\\Sticking_In_My_Eye.mp3 wait", NULL, 0, 0); // play Rancid
    break;
    case 4:
    mciSendString (L"play H:\\Desktop\\The_Beautiful_People.mp3 wait", NULL, 0, 0); // play Marilyn Manson
    break;
    }
    }

    void stop ()

    {

    }
    [/quote


    If anyone has any clue AT ALL on how to get this bad boy working you'd go down as a hero. It's worth 50% of my mark...

    Ideally if you could physically show me where to put the code instead of trying to explain it, 'cause this stuff goes straight over my head.

    O and if it matters, I'm on visual studio 2008.

    Cheers people.

  2. #2
    Join Date
    Oct 2005
    Posts
    230

    Re: Complete C++ novice :(

    Hi nookie_egg,

    Welcome to the forums, and c++!

    Firstly, no-one on here will do your homework for you. If you want to be given the answer you will need to go somewhere else. However, 99&#37; of people on here will be more than happy to help you understand the problems, give you hints etc so you can complete the task.

    Secondly, a good habit to get into is using code tags around you code, points for trying with the "quote" tags anyways .

    Start by checking out this link, specifically the switch statement section (bottom of the page). http://www.cplusplus.com/doc/tutorial/control/
    In fact I think going to the previous and next pages of the same site would be of benefit to you as well.

    Input and output (For getting your users selection etc): http://www.cplusplus.com/doc/tutorial/basic_io/
    Functions: http://www.cplusplus.com/doc/tutorial/functions/

    Regards,
    Dan
    Last edited by UnfitElf; March 9th, 2010 at 02:09 PM.
    Learning somthing new every day!

  3. #3
    Join Date
    Mar 2010
    Posts
    2

    Re: Complete C++ novice :(

    ok ill have a look, thanks mate

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured