Results 1 to 8 of 8

Thread: How to read a CD

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2010
    Posts
    40
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default How to read a CD

    I am developing a Qt application that needs to read from the CD drive, specifically audio CDs. I have included libkcompactdisc and have created a KCompactDisc object. It sees the drive and identifies the drive name, manufacturer, etc. but cannot see the disc in the drive. The OS knows there is a disc in the drive. Every other application on the system sees the CD. But the KCompactDisc object tells me there is no disc. In the rather sparse documentation for this library, I noticed there were functions for Disc Title, Disc Length, and others, as well as commands for play, stop, etc. But there does not seem to be a read or load command. SO HOW DO I GET THE OBJECT TO READ THE FREAKING DISC??? Sorry for shouting but I am going crazy here. Here is the code snippet I am using.


    Qt Code:
    1. Disc = new KCompactDisc(KCompactDisc::Synchronous);
    2. Disc->setAutoMetadataLookup(true);
    3. x = Disc->setDevice(Disc->defaultCdromDeviceName(),50,true,Disc->audioSystems().at(0));
    4. QObject::connect(Disc,SIGNAL(discInformation(KCompactDisc::DiscInfo)),this,SLOT(DisplayDiscInfo(KCompactDisc::DiscInfo)));
    5. ui->txtCDInfo->setText(Disc->defaultCdromDeviceName() + "\n"
    6. + Disc->discArtist() + "\n" +
    7. Disc->discTitle() + "\n" +
    8. "Disc ID: " + QString::number(Disc->discId()) + "\n"
    9. + "Disc Length: " + QString::number(Disc->discLength()));
    To copy to clipboard, switch view to plain text mode 

    The text box shows the name of the drive, blank lines for the artist and title, and zeroes for Disc ID and Length. When I set a breakpoint at the last line and look at the object, the Disc Status is no disc. Any insight you guys can provide would be appreciated. Thanks.
    Last edited by wysota; 21st March 2010 at 10:59.

Similar Threads

  1. QTreeWidget read only?
    By td in forum Newbie
    Replies: 4
    Last Post: 21st July 2009, 12:28
  2. Read-only QCheckBox
    By alu23 in forum Qt Programming
    Replies: 2
    Last Post: 22nd April 2008, 16:25
  3. Best way to read xml
    By steg90 in forum Qt Programming
    Replies: 3
    Last Post: 26th September 2007, 17:38
  4. How to read CD with read?
    By vishal.chauhan in forum Qt Programming
    Replies: 6
    Last Post: 29th June 2007, 08:20
  5. How to I get read of the message
    By jcr in forum General Discussion
    Replies: 1
    Last Post: 16th April 2007, 15:22

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.