Adding titles, images, and files
Re: Adding titles, images, and files
Looks promising, but not really familiar to me?! Would you mind sharing the code you've used to make this happen?
Here's another (?) 'workaround': https://autohotkey.com/board/topic/74758-tip-how-to-set-row-height-for-listview/
Here's another (?) 'workaround': https://autohotkey.com/board/topic/74758-tip-how-to-set-row-height-for-listview/
Re: Adding titles, images, and files
As an alternative, EMDB (https://www.emdb.eu/) does this for you automatically. Just point it a location where movies are stored using the Hard Disk icon in the menubar.
Re: Adding titles, images, and files
@RickC - Had to realize that my favourite inventory app for iOS (CD/DVD/... barcode scan, searching Amazon) has died *sigh*.
R.I.P 'itemShelf' (https://github.com/dev2dev/itemshelf)
R.I.P 'itemShelf' (https://github.com/dev2dev/itemshelf)
Re: Adding titles, images, and files
yah, I saw that as an example as well. This is what I went with, as it seemed to work without changing much code.BoBo wrote: ↑01 Sep 2020, 10:01Looks promising, but not really familiar to me?! Would you mind sharing the code you've used to make this happen?
Here's another (?) 'workaround': https://autohotkey.com/board/topic/74758-tip-how-to-set-row-height-for-listview/
Code: Select all
IconWidth := 2
IconHeight := 50
IconBitDepth := 24
InitialCount := 1
GrowCount :=
ImageListID := DllCall( "ImageList_Create", Int,IconWidth, Int,IconHeight
, Int,IconBitDepth, Int,InitialCount
, Int,GrowCount )
LV_SetImageList( ImageListID, 1 )
Re: Adding titles, images, and files
No really desiring something already done. I'm learning and it's more gratifying when you do something yourself... thank you though. Looks like a great movie program!RickC wrote: ↑01 Sep 2020, 10:29As an alternative, EMDB (https://www.emdb.eu/) does this for you automatically. Just point it a location where movies are stored using the Hard Disk icon in the menubar.
Re: Adding titles, images, and files
Epialis, could you post your whole script? I'd be keen to check it out and see if I can make something work or you.
Re: Adding titles, images, and files
Okay, I have it where I can press enter on the list in the listview, and it plays the video I tell it to in my VLC player. I need it, however, to insert this in every listing I add to the listview. Like how it creates a new row when you add another title, it needs to recognize the move and vlc media player and update each one based on the movie title. Right no I manually add the file in the script... I need it to auto add as I add the movie titles. Any help would be appreciated. Thank you!
So if I enter The Stand, year 2000, then it puts in the command
So if I enter The Stand, year 2000, then it puts in the command
Code: Select all
ButtonCLICK:
GuiControlGet, FocusedControl, FocusV
if (FocusedControl != "MyListView")
return
;MsgBox % "Enter was pressed. The focused row number is " . LV_GetNext(0, "Focused")
SetTitleMatchMode, 2
ControlSend, , {Enter}, VLC media player
Run, C:\Users\dclar\Desktop\DO NOT TOUCH\Brand New Installs\MOVIES\Sent to BACKUP\The_Stand\stand.mp4 C:\Program Files (x86)\VideoLAN\VLC\vlc.exe
return
Code: Select all
Gui +AlwaysOnTop +resize
Gui, Show, x100 y100 w500 h500
Gui, Add, ListView, sort -ReadOnly grid x10 y5 h360 w400 +hscroll vMyListView gMyListview, Title
| Year | Image
Gui, Add, Button, section gAddItem, Add Movie Title
Gui, Add, Text, w52 section , Movie Title
Gui, Add, Edit, w100 ys vTitle1 hwndOne
SetEditCueBanner(One, "Title")
Gui, Add, Text, ys, Year
Gui, Add, Edit, w150 ys vYear1 hwndTwo
SetEditCueBanner(Two, "Year")
pathToPic := ""
GUI Add, Button, w65 ys gpushPic, Add Image ; add a button and set its g-label to be 'pushPic' (https://www.autohotkey.com/docs/commands/Gui.htm#label)
Gui, Add, Picture, w65 h100 ys vNewVar hwndThree, %Newvar%
Gui, Add, Button, Hidden Default, CLICK
Re: Adding titles, images, and files
I think I can do it by doing what I did with the image? Add the link to the actually movie file and then focus it to each row/field???? Maybe.. any thoughts?
Re: Adding titles, images, and files
YAY, okay, I have it now adding the movie and linking the movie to the title of the movie and playing it. But I want to be able to click on the title to play the movie. Here's the code. It only works when I press Enter only.. What am I missing?
Code: Select all
ButtonCLICK:
GuiControlGet, FocusedControl, FocusV
if (FocusedControl != "MyListView")
return
SetTitleMatchMode, 2
ControlSend, , {LButton}, VLC media player
Run, %Newvar1% C:\Program Files (x86)\VideoLAN\VLC\vlc.exe
return
Re: Adding titles, images, and files
Well, yay wasn't warranted yet *cries* lol
Why would it play the movie when you first add it, but when you close it, and re open, it gives an error? The ini file saves the url and the image, name and year just fine... not sure why it wouldn't replay it after saving the information?
The error is the line above... here's the line..
And I created my variable here...
Why would it play the movie when you first add it, but when you close it, and re open, it gives an error? The ini file saves the url and the image, name and year just fine... not sure why it wouldn't replay it after saving the information?
The error is the line above... here's the line..
Code: Select all
Run, %Newvar1% C:\Program Files (x86)\VideoLAN\VLC\vlc.exe
And I created my variable here...
Code: Select all
pushPic1:
Gui, Submit, NoHide ; <- GuiControlGet would work here too
FileSelectFile, path, 3, % pathToPic1, Select Movie File, Pictures (*.mp4; ) ; displays a standard dialog that allows the user to choose a picture
Newvar1 := % path
GuiControl,, Newvar1, %Newvar1%
Re: Adding titles, images, and files
WEll ughh... It only plays the first movie I put into the list... if I add other titles, it still only plays the first movie I enter... Some reason not focusing. I"m going to bed lol... long day... will tackle tomorrow.. blessings all..
Re: Adding titles, images, and files
Okay, the msgbox shows the correct row and is identify the focused row that it's on, but it's not recognizing the movie. Not sure why it shows the row, but won't show the right movie. It gives me an error on the run command. Any ideas? I trided it without the brackets and size as well and still get same error on the run, command.
Code: Select all
GuiControlGet, FocusedControl, FocusV
if (FocusedControl != "MyListView")
return
SetTitleMatchMode, 2
Run, %playmovie% [C:\Program Files (x86)\VideoLAN\VLC\vlc.exe, w500 h500]
MsgBox % "Enter was pressed. The focused row number is " . LV_GetNext(0, "Focused")
return
Re: Adding titles, images, and files
Code: Select all
SetTitleMatchMode, 2
;
;
GuiControlGet, FocusedControl, FocusV
If (FocusedControl != "MyListView")
Return
Run, % "C:\Program Files (x86)\VideoLAN\VLC\vlc.exe " . playmovie . " --width=""500"" --height=""500"" " ; https://wiki.videolan.org/Documentation:Command_line/#Use_the_command_line
MsgBox % "Enter was pressed. The focused row number is " . LV_GetNext(0, "Focused")
Return
Re: Adding titles, images, and files
BoBo wrote: ↑03 Sep 2020, 09:45Untested.Code: Select all
SetTitleMatchMode, 2 ; ; GuiControlGet, FocusedControl, FocusV If (FocusedControl != "MyListView") Return Run, % "C:\Program Files (x86)\VideoLAN\VLC\vlc.exe " . playmovie . " --width=""500"" --height=""500"" " ; https://wiki.videolan.org/Documentation:Command_line/#Use_the_command_line MsgBox % "Enter was pressed. The focused row number is " . LV_GetNext(0, "Focused") Return
Okay, thank you. It opens the vlc media player but doesn't recognize the playmovie.
Code for p lay movie
Code: Select all
pathToMovie := ""
GUI Add, Button, w65 ys gpushMovie, Select Movie File
Gui, Add, Button, w65 h100 ys vplaymovie hwndFour, %playmovie%
Code creating variable for movie mp4
Code: Select all
pushMovie:
Gui, Submit, NoHide ; <- GuiControlGet would work here too
FileSelectFile, path, 3, % pathToMovie, Select Movie File, (*.mp4; ) ; displays a standard dialog that allows the user to choose a picture
playmovie := % path
GuiControl,, playmovie, %playmovie%
return
Re: Adding titles, images, and files
If vlc wont show the movie there's obviously something wrong with the path you're handing over. Simply check the FileSelect-output for consistency, or how you deal with the variable afterwards. Btw, don't do this var = % expression but that var := expression
Re: Adding titles, images, and files
Okay, it says this upon immediately adding the movie and trying to play.
When I reload it, it doesn't say anything...but load the player... so I have something wrong with the url somehow.
Code: Select all
Your input can't be opened:
VLC is unable to open the MRL 'file:///C:/Users/dclar/Desktop/AdvancedTools/My%20Sample%20Scripts/Must%20Use%20and%20Learn%20For%20Program%20Add/My%20Testing%20Folder/Coven.mp4'.
Re: Adding titles, images, and files
As you can see, it puts the correct path to the movie.. so why is the path not working properly when called to play through VLC?
- Attachments
-
- capture12.jpg (42.85 KiB) Viewed 664 times
Re: Adding titles, images, and files
It's not up to AHK to care about VLCs animosity. Probably it's a credential issue, so have a try with RunAs (admin).
https://appuals.com/fix-vlc-is-unable-to-open-the-mrl-file/
https://appuals.com/fix-vlc-is-unable-to-open-the-mrl-file/
Re: Adding titles, images, and files
I don't think it's a right/credential error, it's trying to open the directory of the script is in but also the location of the file. Also, as stated, it will play ONCE and then gives the error after I reload the program; won't play it a second time
Your input can't be opened:
VLC is unable to open the MRL 'file:///C:/Users/dclar/Desktop/AdvancedTools/My%20Sample%20Scripts/Must%20Use%20and%20Learn%20For%20Program%20Add/My%20Testing%20Folder/Activist/Accidental_Activist.mp4'. Check the log for details.
Instead of the actual file location:
C:\Users\dclar\Desktop\DO NOT TOUCH\Brand New Installs\MOVIES\Sent to BACKUP\Christian\Accidental Activist\Accidental_Activist.mp4
And I can't find the error that's doing this.
Your input can't be opened:
VLC is unable to open the MRL 'file:///C:/Users/dclar/Desktop/AdvancedTools/My%20Sample%20Scripts/Must%20Use%20and%20Learn%20For%20Program%20Add/My%20Testing%20Folder/Activist/Accidental_Activist.mp4'. Check the log for details.
Instead of the actual file location:
C:\Users\dclar\Desktop\DO NOT TOUCH\Brand New Installs\MOVIES\Sent to BACKUP\Christian\Accidental Activist\Accidental_Activist.mp4
And I can't find the error that's doing this.
Re: Adding titles, images, and files
Okay, I have been exploring. I enter the file for the mp4 and when I enter it plays. If I enter another movie, the last movie I enter is the one that always plays. So if I have 10 movies entered, it will only play the last title that I entered. Meaning... that all 10 title, no matter their file chosen for the mp4, play the last movie entered. They don't play what they are to play lol... grrr.... Not only that, when I exit the program, it does save all the text and information needed in the file. But when I reload the program, none of the movies play at all. They play the last one I entered until I exit, but then they won't play nothing.
I figured it had to be upon updating file upon exit that was the issue, but I find no issue whatsoever.
Then I thought it was how the file was loaded, but I also find no error there.
So I am not finding error upon saving the file and then reloading the program, unless I am missing something that is obvious LOL.. I do that sometimes. The only other thing I could think of is how it's adding the file... It does play the last movie I enter into the program... but it only plays that movie for ALL the entries I put into the program. SO I looked at the code for adding, and I also find nothing wrong there.
So now, I"m completely exhausted with trying to figure this out. I don't see any errors in the code. Everything is pointing to where it needs to be. The files is saving the correct image location and mp4 location. I'm lost now lol
Sorry for such a long post, but had a lot to cover. Any help appreciated, thank you.
I figured it had to be upon updating file upon exit that was the issue, but I find no issue whatsoever.
Code: Select all
UpdateFile()
{
FileDelete, MovieList.txt
WinGet, Min, MinMax, MovieList
If Min = -1
WinRestore, MovieList
WinGetPos, X, Y, Width, Height, MovieList
Width -= 16
Height -= 38
FileAppend, x%x% y%y% w%Width% h%Height% `n, MovieList.txt
Loop % LV_GetCount()
{
RowNum := A_Index
Loop, 3
{
LV_GetText(Text, RowNum, A_Index)
TrimText := Trim(Text)
FileAppend, "%TrimText%"`,, MovieList.txt
}
LV_GetText(Text, RowNum, 4)
TrimText := Trim(Text)
FileAppend, "%TrimText%"`n, MovieList.txt
}
}
Then I thought it was how the file was loaded, but I also find no error there.
Code: Select all
IfExist, MovieList.txt ;Add data from MovieList.txt to ListView
{
Loop, Read, MovieList.txt
{
If (A_index = 1 and SubStr(A_LoopReadLine, 1, 1) = "x")
{
WinPos := A_LoopReadLine
Continue
}
Else
{
Loop, Parse, A_LoopReadLine , CSV
{
RowData%A_Index% := A_LoopField
}
LV_Add("", RowData1,RowData2,RowData3,RowData4)
}
}
}
Code: Select all
AddItem:
Gui, Submit, NoHide
If SelectedRow = 0
{
LV_Add("", Trim(Title1),Trim(Year1),Trim(NewVar),Trim(playmovie))
}
else
{
LV_Modify(SelectedRow,"", Year1,Title1,NewVar,playmovie)
LV_ModifyCol(1,"Sort")
SelectedRow := 0
GuiControl, ,Button1, Add to list
}
Sorry for such a long post, but had a lot to cover. Any help appreciated, thank you.
Who is online
Users browsing this forum: Ineedhelplz, Spawnova and 240 guests