Results 1 to 4 of 4

Thread: Phonon and simple player...

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2011
    Posts
    15
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Phonon and simple player...

    i want to make a simple console mp3 player. I want my program to take a name of the music file in console as a paramenter argv[]. But i have a problem:

    Qt Code:
    1. #include <QCoreApplication>
    2. #include <phonon/AudioOutput>
    3. #include <phonon/MediaObject>
    4.  
    5. int main(int argc, char *argv[])
    6. {
    7. QCoreApplication app(argc, argv);
    8.  
    9. Phonon::MediaObject obj;
    10. Phonon::AudioOutput out;
    11.  
    12. obj.setCurrentSource(Phonon::MediaSource(argv[1])); //!!!!!!!!!!!!!!
    13. Phonon::createPath(&obj, &out);
    14. obj.play();
    15.  
    16. return app.exec();
    17. }
    To copy to clipboard, switch view to plain text mode 


    the problem is here
    Qt Code:
    1. obj.setCurrentSource(Phonon::MediaSource(argv[1])); //!!!!!!!!!!!!!!
    To copy to clipboard, switch view to plain text mode 

    i think it is because MediaSource takes CONST QSTRING & parameter
    but i do not know what to do! help me please!
    Last edited by wysota; 6th March 2011 at 20:33. Reason: missing [code] tags

Similar Threads

  1. Phonon Player Disappears When resizing/repainting
    By saltman in forum Qt Programming
    Replies: 0
    Last Post: 18th November 2010, 19:44
  2. Phonon Video Player Problem...
    By emrez in forum Qt Programming
    Replies: 0
    Last Post: 14th July 2010, 14:26
  3. Replies: 0
    Last Post: 8th April 2010, 02:39
  4. Phonon Video Player + XML
    By igor.schkrab in forum Qt Programming
    Replies: 0
    Last Post: 24th November 2009, 23:49
  5. problem with phonon/music player example.
    By rishiraj in forum Newbie
    Replies: 9
    Last Post: 23rd January 2009, 08:00

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.