Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

cr/lf plus cleanup

  • Loading branch information...
commit 9ee83a51ac9058ff53c9a63aaf11597399a55521 1 parent 47b1a6a
Norman Casagrande nova77 authored
32 fplib/src/Filter.cpp
... ... @@ -1,19 +1,19 @@
1   -/***************************************************************************
2   -* This file is part of last.fm fingerprint app *
3   -* Last.fm Ltd <mir@last.fm> *
4   -* *
5   -* The last.fm fingerprint app is free software: you can redistribute it *
6   -* and/or modify it under the terms of the GNU General Public License as *
7   -* published by the Free Software Foundation, either version 3 of the *
8   -* License, or (at your option) any later version. *
9   -* *
10   -* The last.fm fingerprint app and library are distributed in the hope that *
11   -* it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
12   -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See *
13   -* the GNU General Public License for more details. *
14   -* *
15   -* You should have received a copy of the GNU General Public License *
16   -* along with The last.fm fingerprint. *
  1 +/***************************************************************************
  2 +* This file is part of last.fm fingerprint app *
  3 +* Last.fm Ltd <mir@last.fm> *
  4 +* *
  5 +* The last.fm fingerprint app is free software: you can redistribute it *
  6 +* and/or modify it under the terms of the GNU General Public License as *
  7 +* published by the Free Software Foundation, either version 3 of the *
  8 +* License, or (at your option) any later version. *
  9 +* *
  10 +* The last.fm fingerprint app and library are distributed in the hope that *
  11 +* it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
  12 +* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See *
  13 +* the GNU General Public License for more details. *
  14 +* *
  15 +* You should have received a copy of the GNU General Public License *
  16 +* along with The last.fm fingerprint. *
17 17 * If not, see <http://www.gnu.org/licenses/>. *
18 18 * *
19 19 * Part of this code is based on the work of Y. Ke, D. Hoiem, and *
32 fplib/src/FingerprintExtractor.cpp
... ... @@ -1,19 +1,19 @@
1   -/***************************************************************************
2   -* This file is part of last.fm fingerprint app *
3   -* Last.fm Ltd <mir@last.fm> *
4   -* *
5   -* The last.fm fingerprint app is free software: you can redistribute it *
6   -* and/or modify it under the terms of the GNU General Public License as *
7   -* published by the Free Software Foundation, either version 3 of the *
8   -* License, or (at your option) any later version. *
9   -* *
10   -* The last.fm fingerprint app and library are distributed in the hope that *
11   -* it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
12   -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See *
13   -* the GNU General Public License for more details. *
14   -* *
15   -* You should have received a copy of the GNU General Public License *
16   -* along with The last.fm fingerprint. *
  1 +/***************************************************************************
  2 +* This file is part of last.fm fingerprint app *
  3 +* Last.fm Ltd <mir@last.fm> *
  4 +* *
  5 +* The last.fm fingerprint app is free software: you can redistribute it *
  6 +* and/or modify it under the terms of the GNU General Public License as *
  7 +* published by the Free Software Foundation, either version 3 of the *
  8 +* License, or (at your option) any later version. *
  9 +* *
  10 +* The last.fm fingerprint app and library are distributed in the hope that *
  11 +* it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
  12 +* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See *
  13 +* the GNU General Public License for more details. *
  14 +* *
  15 +* You should have received a copy of the GNU General Public License *
  16 +* along with The last.fm fingerprint. *
17 17 * If not, see <http://www.gnu.org/licenses/>. *
18 18 * *
19 19 * Part of this code is based on the work of Y. Ke, D. Hoiem, and *
32 fplib/src/fp_helper_fun.h
... ... @@ -1,19 +1,19 @@
1   -/***************************************************************************
2   -* This file is part of last.fm fingerprint app *
3   -* Last.fm Ltd <mir@last.fm> *
4   -* *
5   -* The last.fm fingerprint app is free software: you can redistribute it *
6   -* and/or modify it under the terms of the GNU General Public License as *
7   -* published by the Free Software Foundation, either version 3 of the *
8   -* License, or (at your option) any later version. *
9   -* *
10   -* The last.fm fingerprint app and library are distributed in the hope that *
11   -* it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
12   -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See *
13   -* the GNU General Public License for more details. *
14   -* *
15   -* You should have received a copy of the GNU General Public License *
16   -* along with The last.fm fingerprint. *
  1 +/***************************************************************************
  2 +* This file is part of last.fm fingerprint app *
  3 +* Last.fm Ltd <mir@last.fm> *
  4 +* *
  5 +* The last.fm fingerprint app is free software: you can redistribute it *
  6 +* and/or modify it under the terms of the GNU General Public License as *
  7 +* published by the Free Software Foundation, either version 3 of the *
  8 +* License, or (at your option) any later version. *
  9 +* *
  10 +* The last.fm fingerprint app and library are distributed in the hope that *
  11 +* it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
  12 +* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See *
  13 +* the GNU General Public License for more details. *
  14 +* *
  15 +* You should have received a copy of the GNU General Public License *
  16 +* along with The last.fm fingerprint. *
17 17 * If not, see <http://www.gnu.org/licenses/>. *
18 18 * *
19 19 * Part of this code is based on the work of Y. Ke, D. Hoiem, and *
32 lastfmfpclient/src/MP3_Source.h
... ... @@ -1,19 +1,19 @@
1   -/***************************************************************************
2   -* This file is part of last.fm fingerprint app *
3   -* Last.fm Ltd <mir@last.fm> *
4   -* *
5   -* The last.fm fingerprint app is free software: you can redistribute it *
6   -* and/or modify it under the terms of the GNU General Public License as *
7   -* published by the Free Software Foundation, either version 3 of the *
8   -* License, or (at your option) any later version. *
9   -* *
10   -* The last.fm fingerprint app and library are distributed in the hope that *
11   -* it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
12   -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See *
13   -* the GNU General Public License for more details. *
14   -* *
15   -* You should have received a copy of the GNU General Public License *
16   -* along with The last.fm fingerprint. *
  1 +/***************************************************************************
  2 +* This file is part of last.fm fingerprint app *
  3 +* Last.fm Ltd <mir@last.fm> *
  4 +* *
  5 +* The last.fm fingerprint app is free software: you can redistribute it *
  6 +* and/or modify it under the terms of the GNU General Public License as *
  7 +* published by the Free Software Foundation, either version 3 of the *
  8 +* License, or (at your option) any later version. *
  9 +* *
  10 +* The last.fm fingerprint app and library are distributed in the hope that *
  11 +* it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
  12 +* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See *
  13 +* the GNU General Public License for more details. *
  14 +* *
  15 +* You should have received a copy of the GNU General Public License *
  16 +* along with The last.fm fingerprint. *
17 17 * If not, see <http://www.gnu.org/licenses/>. *
18 18 * *
19 19 * Part of this code is based on the work of Y. Ke, D. Hoiem, and *
53 lastfmfpclient/src/main.cpp
... ... @@ -1,19 +1,19 @@
1   -/***************************************************************************
2   -* This file is part of last.fm fingerprint app *
3   -* Last.fm Ltd <mir@last.fm> *
4   -* *
5   -* The last.fm fingerprint app is free software: you can redistribute it *
6   -* and/or modify it under the terms of the GNU General Public License as *
7   -* published by the Free Software Foundation, either version 3 of the *
8   -* License, or (at your option) any later version. *
9   -* *
10   -* The last.fm fingerprint app and library are distributed in the hope that *
11   -* it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
12   -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See *
13   -* the GNU General Public License for more details. *
14   -* *
15   -* You should have received a copy of the GNU General Public License *
16   -* along with The last.fm fingerprint. *
  1 +/***************************************************************************
  2 +* This file is part of last.fm fingerprint app *
  3 +* Last.fm Ltd <mir@last.fm> *
  4 +* *
  5 +* The last.fm fingerprint app is free software: you can redistribute it *
  6 +* and/or modify it under the terms of the GNU General Public License as *
  7 +* published by the Free Software Foundation, either version 3 of the *
  8 +* License, or (at your option) any later version. *
  9 +* *
  10 +* The last.fm fingerprint app and library are distributed in the hope that *
  11 +* it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
  12 +* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See *
  13 +* the GNU General Public License for more details. *
  14 +* *
  15 +* You should have received a copy of the GNU General Public License *
  16 +* along with The last.fm fingerprint. *
17 17 * If not, see <http://www.gnu.org/licenses/>. *
18 18 * *
19 19 * Part of this code is based on the work of Y. Ke, D. Hoiem, and *
@@ -57,10 +57,11 @@ using namespace std;
57 57 // DO NOT CHANGE THOSE!
58 58 const char FP_SERVER_NAME[] = "ws.audioscrobbler.com/fingerprint/query/";
59 59 const char METADATA_SERVER_NAME[] = "http://ws.audioscrobbler.com/2.0/";
60   -//"http://ws.audioscrobbler.com/fingerprint/";
61   -const char PUBLIC_CLIENT_NAME[] = "FP Beta 1.6";
  60 +const char PUBLIC_CLIENT_NAME[] = "fp client 1.6";
62 61 const char HTTP_POST_DATA_NAME[] = "fpdata";
63 62
  63 +// if you want to use the last.fm fingerprint library in your app you'll need
  64 +// your own key
64 65 const char LASTFM_API_KEY[] = "2bfed60da64b96c16ea77adbf5fe1a82";
65 66
66 67 // -----------------------------------------------------------------------------
@@ -193,31 +194,18 @@ void getFileInfo( const string& fileName, map<string, string>& urlParams, bool d
193 194 {
194 195 cerr << "WARNING: Taglib could not extract any information!" << endl;
195 196 }
196   -
197 197 }
198 198
199 199 // -----------------------------------------------------------------------------
200 200
201 201 string fetchMetadata(int fpid, HTTPClient& client, bool justURL)
202 202 {
203   - //ostringstream fpss;
204   - //fpss << fpid;
205   - //string fpidStr = fpss.str();
206   -
207 203 ostringstream oss;
208 204 oss << METADATA_SERVER_NAME
209 205 << "?method=track.getfingerprintmetadata"
210 206 << "&fingerprintid=" << fpid
211 207 << "&api_key=" << LASTFM_API_KEY;
212 208
213   - //string::reverse_iterator rIt;
214   - //const int maxLev = 4; // max 4 levels in the dir structure
215   - //int levCounter = 0;
216   - //for ( rIt = fpidStr.rbegin(); rIt != fpidStr.rend() && levCounter < maxLev; ++rIt, ++levCounter )
217   - // oss << *rIt << '/';
218   -
219   - //oss << fpidStr << ".xml";
220   -
221 209 if ( justURL )
222 210 return oss.str();
223 211
@@ -352,7 +340,8 @@ int main(int argc, char* argv[])
352 340 exit(1);
353 341 }
354 342
355   - // this is absolutely mandatory!
  343 + // WARNING!!! This is absolutely mandatory!
  344 + // If you don't specify the right duration you will not get the correct result!
356 345 if ( forceDuration > 0 )
357 346 urlParams["duration"] = toString(forceDuration);
358 347 else

0 comments on commit 9ee83a5

Please sign in to comment.
Something went wrong with that request. Please try again.