demo3.cpp   demo3.cpp 
/************************************************************************** /*
* This software is in the public domain, furnished "as is", without techni
* Copyright 2005-2009 Last.fm Ltd. cal
* support, and with no warranty, express or implied, as to its usefulness
* for
* any purpose.
* This program is free software; you can redistribute it and/or modify */
*
* it under the terms of the GNU General Public License as published by #include "Audioscrobbler.h"
* #include "ws.h"
* the Free Software Foundation; either version 2 of the License, or #include "Track.h"
*
* (at your option) any later version.
*
*
*
* This program is distributed in the hope that it will be useful,
*
* but WITHOUT ANY WARRANTY; without even the implied warranty of
*
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
*
* GNU General Public License for more details.
*
*
*
* You should have received a copy of the GNU General Public License
*
* along with this program; if not, write to the
*
* Free Software Foundation, Inc.,
*
* 51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA.
*
**************************************************************************
*/
#include <lastfm.h>
#include <QtCore> #include <QtCore>
#include <QtNetwork> #include <QtNetwork>
#include "src/_version.h"
struct MyCoreApp : QCoreApplication struct MyCoreApp : QCoreApplication
{ {
Q_OBJECT Q_OBJECT
public: public:
MyCoreApp( int& argc, char** argv ) : QCoreApplication( argc, argv ) MyCoreApp( int& argc, char** argv ) : QCoreApplication( argc, argv )
{} {}
public slots: public slots:
void onStatus( int status ) void onStatus( int status )
{ {
qDebug() << lastfm::Audioscrobbler::Status(status); qDebug() << lastfm::Audioscrobbler::Status(status);
} }
}; };
int main( int argc, char** argv ) int main( int argc, char** argv )
{ {
// all these are REQUIRED in order to scrobble // all 6 of these lines are REQUIRED in order to scrobble
Ws::Username = ""; // this demo requires you to fill in the blanks as well...
Ws::ApiKey = ""; lastfm::ws::Username = "";
Ws::SharedSecret = ""; lastfm::ws::ApiKey = "";
Ws::SessionKey = ""; // you need to auth to get this... try demo2 lastfm::ws::SharedSecret = "";
lastfm::ws::SessionKey = ""; // you need to auth to get this... try dem
o2
QCoreApplication::setApplicationName( "liblastfm" ); QCoreApplication::setApplicationName( "liblastfm" );
QCoreApplication::setApplicationVersion( VERSION );
MyCoreApp app( argc, argv ); MyCoreApp app( argc, argv );
lastfm::MutableTrack t; lastfm::MutableTrack t;
t.setArtist( "Max Howell" ); t.setArtist( "Max Howell" );
t.setTitle( "I Told You Not To Trust Me With Your Daughter" ); t.setTitle( "I Told You Not To Trust Me With Your Daughter" );
t.setDuration( 30 ); t.setDuration( 30 );
t.stamp(); //sets track start time t.stamp(); //sets track start time
lastfm::Audioscrobbler as( "ass" ); lastfm::Audioscrobbler as( "ass" );
 End of changes. 5 change blocks. 
44 lines changed or deleted 18 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/