Welcome! Log In Create A New Profile

Advanced

Help

Posted by criley 
Announcements Last Post
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
Help
July 19, 2007 07:35PM
I think i have lost my mind. I am struggling to do the most basic of coding and cannot get the first part of the assignment to work.

I have the MP3song class and have the MP3File.h and MP3file.cpp.

From there I have hit a brick wall:

I know that we have to define the playlistmodel but I just cannot get it right.

Mp3song appears to inherit playlistmodel ( according to the UML diagram) but then how does that link in?

Please could someone could give me an outline of the files that i need and the classes that each file needs to include I would really appreciate it.

This subject really makes me feel stupid........
Re: Help
July 19, 2007 09:01PM
At first PlayListModel confused me, I didn't know if I should use the downloaded header or not. By the way you don't, you have to create your own that is completely different.

You need the following files
Mp3Song.h       - You can download this
Mp3File.h & cpp - Extends Mp3Song.h
PlayListModel.h - Extends QList<Mp3Song*>

Put a main method somewhere where you create a Mp3File, add it to the playlist and retrieve it again.

Hope that helps a bit.
Anonymous User
Re: Help
July 19, 2007 09:58PM
Hi

I do not agree. With this part in the previous post:
"PlayListModel.h - Extends QList<Mp3Song*>"

The UML on page 554 is wrong, PlayListmodel should not be there. The UML on page 556 is correct. There is a "has a" relationship between PlayListModel and Mp3Song. So QList<Mp3Song*> will be a data member in PlayListModel, PlayListmodel does not extend Mp3Song it contains it as a datamember.

Cheers
Re: Help
July 19, 2007 10:07PM
cfdl Wrote:
-------------------------------------------------------
> Hi
>
> I do not agree. With this part in the previous
> post:
> "PlayListModel.h - Extends QList"
>
> The UML on page 554 is wrong, PlayListmodel should
> not be there. The UML on page 556 is correct.
> There is a "has a" relationship between
> PlayListModel and Mp3Song. So QList will be a data
> member in PlayListModel, PlayListmodel does not
> extend Mp3Song it contains it as a datamember.
>
> Cheers

That is what I thought at first as well but it's not (I thought the arrow should have been an aggregate diamond).

The playlistmodel (UML) on page 556 refers to the playlistmodel provided by them for the next assignment, the one on page 554 is what is required of us. That is what it says in the assigment section of pg 555.
Anonymous User
Re: Help
July 19, 2007 10:16PM
I'm going the p556 route, makes more sense

You na get mp3file.h and mp3file.cpp on this site just scratch around:

http://cartan.cas.suffolk.edu/oopdocbook/api/html/classMp3File.html
Re: Help
July 20, 2007 01:53PM
Thanks very much - I will attempt it again tonight.
The willingness to help has been fantastic .......
Re: Help
July 31, 2007 04:24PM
Hi

I found the MP3file.h and mp3file.cpp.
I have the mp3song.h

As is - no changes.

When i try to build it gives me an undefined reference to MP3Song::~Mp3song and it gives me this error on line that I have the MP3File::~Mp3file in my mp3file.cpp

What am I not getting?
Re: Help
July 31, 2007 09:11PM
I also had the undefined reference for the virtual dtor ~Mp3Song. I think the compiler found the declaration in the .h file but couldn't find any implementation in the .cpp file. I found that either of 2 things would work:

1. Remove the dtor declaration from the .h file: the compiler automatically
creates a virtual dtor in the absence of one. or;
2. Give the dtor an empty body in the .h file, i.e.: virtual ~Mp3Song() {}

I'm not sure if this is good programming, just happy that its not giving the undefined error thing anymore!! smiling smiley
Sorry, only registered users may post in this forum.

Click here to login