Warning: Non-static method vBSEO_Storage::path() should not be called statically in ..../vbseo/includes/functions_vbseo_pre.php on line 387

Warning: Non-static method vBSEO_Storage::path() should not be called statically in ..../vbseo/includes/functions_vbseo_pre.php on line 387

Warning: Non-static method vBSEO_Storage::path() should not be called statically in ..../vbseo/includes/functions_vbseo_seo.php on line 337

Warning: Non-static method vBSEO_Storage::path() should not be called statically in ..../vbseo/includes/functions_vbseo_seo.php on line 339

Warning: Non-static method vBSEO_Storage::path() should not be called statically in ..../vbseo/includes/functions_vbseo_seo.php on line 341

Warning: Non-static method vBSEO_Storage::path() should not be called statically in ..../vbseo/includes/functions_vbseo_seo.php on line 343
Winamp song without the annoying number

Results 1 to 4 of 4
  1. #1
    Senior Member
    Join Date
    May 2006
    Posts
    225

    Winamp song without the annoying number

    Well i was getting annoyed by the number showing at the start of the track when i wanted to display or spam it.

    So i fixed it and will share it with you, and it is very simple.

    First, i found out the current track position (ironically), and put this number in an array and found out the length, simple eh? Luckily, wa_ipc.h provides us with the SendMessage id

    Code:
    int pos = SendMessage(winamp, WM_USER, 0, 125);
    char szPos[6];
    sprintf(szPos, "%i", pos);
    Then find the string length:

    Code:
    int n = realStrlen(szPos)+2;
    The +2 ensures that the fullstop and space following the number is also included.

    Now, i reversed the string containing the song name + number which the winamp forums kindly provides us with, and reversed the string:

    Code:
    char *szRev = _strrev(getCurrentTrack());
    Then, set up a char array or buffer to hold the resulting string, and then copy the string without the number at the front, which is now at the back as it has been reversed.

    Code:
    strncpy(buffer, szRev, realStrlen(szRev)-n);
    If you reverse it now and print the song ingame, you will end up with a lot of random characters after the song, as the array is not completely filled unless you put a restriction on it. So before you reverse the string, you have to put a null terminator where the track name ends, like so:

    Code:
    buffer[s] = '\0';
    Then, simply reverse the string and print in game or do with whatever you want.

    Feel free to comment

  2. #2
    Veteran Member
    Join Date
    Apr 2006
    Location
    Canada
    Posts
    748

    Re: Winamp song without the annoying number

    Uhhhh realStrlen? Is that just the Q3 strlen func that skips the ^ escape chars?
    Code:
    <chaplja|> i'm taking over nixcoders
    <Smileman`> cool

  3. #3
    Coders chaplex's Avatar
    Join Date
    Apr 2006
    Location
    Croatia / Hrvatska
    Posts
    762

    Re: Winamp song without the annoying number

    so, if i get this right, song name with number is i.e.
    Code:
    156. Artist - Song title
    and you want to get it without "156. "?

    if that's what this is about, just do:
    Code:
    char *song = strstr(retreivedSongTitle, ".") + 2;
    The DJs took pills to stay awake and play for seven days
    www.chaplja.info | chaplja@gmail.com

  4. #4
    Senior Member
    Join Date
    May 2006
    Posts
    225

    Re: Winamp song without the annoying number

    Lol, didn't think of that. Still will get the same result though, mine just takes a lot more processing. Cheers.

    and @couch, i only used realStrlen because it is c+p out of my et hack, strlen returns the same result, so it makes no difference.

Similar Threads

  1. Annoying name stealer
    By MindReader in forum Enemy Territory Cheats
    Replies: 4
    Last Post: October 12th, 2008, 11:19
  2. siLenCer -Confirmation number....
    By omd in forum Pre-Sales Questions
    Replies: 2
    Last Post: August 2nd, 2008, 10:46
  3. Mr. Annoying Scripts!
    By (-BL!P-) in forum Counterstrike 1.6 Cheats
    Replies: 0
    Last Post: April 9th, 2008, 06:59
  4. annoying cheat!!
    By gilly in forum Enemy Territory Cheats
    Replies: 10
    Last Post: December 9th, 2006, 00:30

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
  •