AutoHotkey Community

It is currently May 27th, 2012, 10:39 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 33 posts ]  Go to page 1, 2, 3  Next
Author Message
PostPosted: May 26th, 2004, 1:20 am 
Offline

Joined: March 28th, 2004, 3:53 pm
Posts: 1870
press ctrl+f12 then type any part of the name of song and press enter (or let it timeout by 5 secs) and the song plays! ..u can even add complete folders using this (add \ as prefix for folders)...works from all apps. doesn't even let other apps see that u're typing the song name!

if u press Insert instead of Enter, then songs will be added to playlist!

(change paths to point to your winamp installation and your songs folder)

Code:
SetBatchLines, 10ms

^F12::
        Input, UserInput, T5,{enter}{ins}
        ifequal,userinput,, return
        endkey=%errorlevel%
        Loop, e:\audio\mp3\*.*, 1, 1
        {
                mp3 = %A_LoopFileFullPath%
                Found = Yes
                Loop, Parse, UserInput, %a_space%
                        IfNotInString, mp3, %A_LoopField%, SetEnv, Found, No

                IfEqual, Found, Yes
                {
                        Ifnotinstring, mp3,.mp3, Ifinstring, mp3,., break

                        ifequal, endkey, Endkey:Insert, run, e:\program files\winamp\winamp.exe /ADD "%mp3%"
                        ifnotequal, endkey, Endkey:Insert, run, e:\program files\winamp\winamp.exe "%mp3%"
                        Found = No
                        break
                }
        }
Return
 

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 26th, 2004, 1:43 am 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
That's pretty sweet, a stealth song player. People see you typing, and then a song plays.

For your next trick, please improve it to accept voice commands :)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 26th, 2004, 5:55 am 
Offline

Joined: March 28th, 2004, 3:53 pm
Posts: 1870
u psychic Chris? :)

i've recently enabled voice commands by using a software with AHK, and was going to make a post regarding that sometime, so that anybody else interested may also use it.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 26th, 2004, 1:18 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
Yes, that interests me. In an ideal world, I would like to be able to whisper a song name from 100 feet away, and due to sophisticated signal processing and a sensitive microphone, the computer would recognize the name and/or artist and play the song(s) I've requested.

Please deliver this solution by Monday ;)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 26th, 2004, 7:45 pm 
Offline

Joined: March 28th, 2004, 3:53 pm
Posts: 1870
and when i'm doing it, would u also like the added feature of your pc detecting what mood u're in right now and playing a suitable song by itself to make u feel better? :P

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 27th, 2005, 1:20 pm 
Offline

Joined: October 19th, 2004, 12:11 pm
Posts: 102
Rajat wrote:
and when i'm doing it, would u also like the added feature of your pc detecting what mood u're in right now and playing a suitable song by itself to make u feel better? :P


OK, so it's not fully automated, but this program does something along those lines. I've used if for a while now and highly recommend it. The developers are almost as interactive and helpful as Chris!

C


Report this post
Top
 Profile  
Reply with quote  
 Post subject: nice
PostPosted: May 7th, 2005, 1:00 pm 
Hi Rajat, nice one, I really like the idea! However, the script does not find all of my mp3s. There are round about 8.000 mp3-files in my sub-folders and your script is finding nearly the half pretty fast.

As an example: I got some files of "rage against the machine". When I search for "rage" the script does not find any file. For "against" all files are detected correctly.
Another example: There are 3 Songs of "Andreas Johnson" in the same folder. Searching for "Andreas" or "Johnson" the script just found one song (the first one in alphabetical order).

Any idea? Thanks anyway for the script!


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: May 7th, 2005, 2:06 pm 
Offline

Joined: March 28th, 2004, 3:53 pm
Posts: 1870
finding first song is default and intended behaviour. as for not finding songs, check for spelling errors please.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 8th, 2005, 4:06 pm 
All right, now I've seen how it works:
whatever the script finds first, a mp3-file or a folder, will be opened with winamp. That's why there are sometimes more than one file opened by the script.
When I search for "Rage", the script finds "David Bowie - Suffragette City.mp3" first and ignors all files from "rage against the machine".
In my opinion, the 'perfect' skript would do the following:

Code:
- new playlist
- currentDir = startDir
- search(currentDir)
- END

- METHOD search(currentDir)
  - if searchstring is in name of currentDir: add all files to playlist
  - if searchstring is in name of file(s) in currentDir: add file(s) to playlist
  - search(nextSubDir)


At the end, we've found all MP3s containing the searchstring and all MP3s in folders containing the searchstring.

This is just an idea. Unfortunately, I don't have the experience the implement that for AutoHotkey.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: May 8th, 2005, 4:26 pm 
Offline
User avatar

Joined: December 29th, 2004, 1:28 pm
Posts: 2545
Anonymous wrote:
All right, now I've seen how it works:
whatever the script finds first, a mp3-file or a folder, will be opened with winamp. That's why there are sometimes more than one file opened by the script.
When I search for "Rage", the script finds "David Bowie - Suffragette City.mp3" first and ignors all files from "rage against the machine".
In my opinion, the 'perfect' skript would do the following:

Code:
- new playlist
- currentDir = startDir
- search(currentDir)
- END

- METHOD search(currentDir)
  - if searchstring is in name of currentDir: add all files to playlist
  - if searchstring is in name of file(s) in currentDir: add file(s) to playlist
  - search(nextSubDir)


At the end, we've found all MP3s containing the searchstring and all MP3s in folders containing the searchstring.

This is just an idea. Unfortunately, I don't have the experience the implement that for AutoHotkey.


You could create add a listbox displaying the results and an option to choose a song to play if you'd like to modify the script but that's not how the script was originally intended to work. Find all mp3 files containing "rage" on C drive...
Code:
Loop, c:\*rage*.mp3, 1, 1
{
msgbox, %A_LoopFileFullPath%
}


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 8th, 2005, 5:06 pm 
Why adding a listbox? When I've got more than one song from "Blur" and search for "blur", why not putting all songs in the playlist?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: May 8th, 2005, 5:15 pm 
Offline
User avatar

Joined: December 29th, 2004, 1:28 pm
Posts: 2545
Heiko wrote:
Why adding a listbox? When I've got more than one song from "Blur" and search for "blur", why not putting all songs in the playlist?

Ok. Then add them to the playlist one by one instead of to a listbox...


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 8th, 2005, 7:27 pm 
Offline

Joined: March 28th, 2004, 3:53 pm
Posts: 1870
the idea behind this script is total simplicity + no UI. for more functions u can try my 320mph script / winamp's ML or some plugin.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 8th, 2005, 7:28 pm 
Offline

Joined: March 28th, 2004, 3:53 pm
Posts: 1870
Heiko wrote:
Why adding a listbox? When I've got more than one song from "Blur" and search for "blur", why not putting all songs in the playlist?

...though this sounds good!

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 10th, 2005, 2:51 pm 
All right, I tried myself on the script. I changed the last lines to this:
Code:
                        ifnotequal, endkey, Endkey:Insert,
                        {
                                run, c:\winamp\winamp.exe "%mp3%"
                                Endkey = Insert
                        }
                        Found = No
                }
        }
Return


Now the script does not stop when getting the first match. However, there is one problem left. As far as I see the script add folders and files. So when there's a file Eels - I Like Birds.mp3 in the folder Eels and I search for eels the song will be added 2 times to the playlist.
Can anyone modify the script so that the script does not search in a folder or subfolder when the folder was already added to the playlist?


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 33 posts ]  Go to page 1, 2, 3  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 12 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group