Decorum for the Forum:
  • Be nice. If you want to be mean, try Reddit.
  • No Piracy. If you want to be a thief, there are dark places on the internet dedicated to that.
  • No Cracking. Discussions on AnyDVD, DeUHD, DVDFab, UHDKeys and similar tools are not permitted here.
  • No Spamming. If you want to make a buck, work smarter... somewhere else.
  • No Adult Content. Half the internet is dedicated to adult content. This half isn't.

Privacy Policy: Click Here to Review (updated September 30, 2020)

Custom IP control command according to aspect ratio

Post here to suggest ideas for future versions.
Manni
Posts: 593
Joined: Wed May 22, 2019 5:27 am

Re: Custom IP control command according to aspect ratio

Post by Manni » Thu Nov 09, 2023 1:48 pm

Pauven wrote: Thu Nov 09, 2023 1:26 pm Don't forget that one of my ideas is to have CMC query JRMC to detect if the movie is playing, and only issue the command then. In this case, having the batch file or JVCControl manage time delays is counter-productive. CMC would need to be in control.

Now, if that doesn't pan out, then the time delays can either be in CMC or the batch file, doesn't really matter.

Also keep in mind that the batch file is just a starting off point. It's expected that each user would customize it as they see fit. It's just a template for getting My Movies data from CMC into a batch file, and for evaluating the AR to jump to the correct command section.

I don't see a need to store the current picture mode, rather just that each user sets the default mode for CMC usage, i.e. the 1.78 mode.

Also, I think we need to also send a few more values into the batch file. Media type: DVD, HDDVD, Blu-ray, 4K UHD. Possibly 3D. And possibly HDR. Not sure if those would be useful for controlling projector setup, but seems logical. Anything else you can think of?
Even if you handle in CMC when you send the command (beginning of playback or main title), it doesn't change the fact that most users will want a delay to be applied after each command, simply because madVR for example might send one when the main title starts playing. Given that this is supported by the utility, it makes sense to define a variable there, so the user can adjust easily along with everything else, but it doesn't matter where it's handled. It just means you have to have settings in CMC, and settings in the batch file. It might be easier to have everything in the same place, so if we go batch file to have every setting there?

I'm aware that it's just a template, I'm only suggesting things that you might want to add before I start customizing :)

I disagree re the picture mode. It depends what the user is doing, their preference etc. It would be quite nice to save the current picture mode before changing it, and restore it afterwards, given that the utility supports it, rather than forcing a fixed default. But it doesn't really matter for me, I'm happy with a 1.78 default in my case.

Re the batch file, it's a good idea to send more values for future use. Besides those you mention, you could add (if available):
- SDR or HDR if available, but you might only have encoding
- Encoding
- Resolution, if SDR/HDR isn't available
- Definitely 3D

I lost track, where is the latest version of the batch file? Did you make the changes in the post where you originally shared it?

User avatar
Pauven
Posts: 2794
Joined: Tue Dec 26, 2017 10:28 pm
Location: Atlanta, GA, USA
Contact:

Re: Custom IP control command according to aspect ratio

Post by Pauven » Thu Nov 09, 2023 3:32 pm

Manni wrote: Thu Nov 09, 2023 1:48 pm I lost track, where is the latest version of the batch file? Did you make the changes in the post where you originally shared it?
Yes, I edited the original post.

Manni wrote: Thu Nov 09, 2023 1:48 pm I'm aware that it's just a template, I'm only suggesting things that you might want to add before I start customizing
I'm done for now, feel free to start customizing. This includes adding in any delays, mode logging, and additional fields to work with my testing tool.


And here's the testing tool: DOWNLOAD


Essentially, this tool allows you to simulate how data would come from CMC. You can specify the disc values for Aspect Ratio, Disc Type, HDR and 3D. The values you can choose from come from My Movies, including values you would think are bad/non-existent.

NULL is a placeholder for null/blank values if they exist in MM, and since you can't really pass a blank on a command line as a param, I would text replace with the word NULL so you can interact with it in your batch file.

If the exe/bat is in the same folder, you don't need a full path, otherwise provide the full path to the file you want to run.

image.png
image.png (69.03 KiB) Viewed 4222 times

You can also choose what params you want to pass (in any order you want), up to 4 different params. The batch file I developed only has support for 1 param, Aspect Ratio, so this tool allows enough configurability to support whatever you want to do in the batch file.


Also, consider how this tool works - you choose from a set of values, in whatever order you want, to pass as parameters to an exe or batch file. None of this is specific to JVC, it's generic enough that you can call any bat/exe, and pass different vars in different orders. Add into this a trigger (i.e. on CMC Start, Playback Start, Playback End, CMC Close) and this is essentially feature complete code, just would need to integrate it into CMC with a healthy dose of polishing compound.

To expand upon this, instead of just those 4 parameter values, I could add dozens or hundreds of values from MM/CMC that could be exported. That way, when you want to do "something" external to CMC, but with CMC data and based upon a CMC event, you could configure an action using this to do whatever you want, not just change your JVC projector's lens settings.
President, Chameleon Consulting LLC
Author, Chameleon MediaCenter

Manni
Posts: 593
Joined: Wed May 22, 2019 5:27 am

Re: Custom IP control command according to aspect ratio

Post by Manni » Thu Nov 09, 2023 5:09 pm

Looks great, thanks, I’ll test ASAP and will report back.

Manni
Posts: 593
Joined: Wed May 22, 2019 5:27 am

Re: Custom IP control command according to aspect ratio

Post by Manni » Thu Nov 09, 2023 6:40 pm

Done some testing, as always you've over-delivered :)

The batch file works great, I've made a few changes:
- added support for 2.00 and 2.20 A/Rs
- added the aspect ratio corresponding to each command in the comments (those are valid just for me)
- corrected a comment that mentionned raw: in your example
- added support for 3D picture mode with 3D content, switching back to 2D otherwise.
- made a slight change to the limit between 2.35 and 2.40
- added a pause to prevent commands from being lost, the pause option in the utility is pointless, apparently it pauses before the command according to the doc, plus you have to use a /w switch to call the batch file. As expected, I needed 5 seconds but it might be more for some users.

Here is my modified test file:

Code: Select all

@echo off
:: Batch Script to run JVCControl.exe to assign a Lens Memory profile and change picture mode to User 3 for 3D content
:: This batch file should be called with the 3 digit Aspect Ratio,
:: with or without the decimal dot.
:: Examples:  either 2.00 or 200 but NOT 2 or 2. or 2.0 or 20
setlocal EnableExtensions EnableDelayedExpansion
:: 3D is the second parameter, true or false

:: change the following variable to the correct path
set JVCControl="C:\Video\JVCControl.exe" 

:: Select User 3 picture mode if content is 3D, else select User 2
if "%2"=="True" goto 3D

:2D
start "" %JVCControl% 6D
timeout /t 5 /nobreak	
goto AR

:3D
start "" %JVCControl% 6E
timeout /t 5 /nobreak							

:AR
:: Evaluate the passed Aspect Ratio parameter as a number again number ranges
:: If the value is missing, default to the standard 16:9 Aspect Ratio 1.85
if %1.==. goto :AR178
set AR=%1
:: Strip out the decimal to make this an integer
call:ReplaceText "!AR!" "." "" AR

:: LEQ means Less Than or Equal To
:: GEQ means Greater Than or Equal To
:: You may change the LEQ/GEQ numbers to set your own preferred ranges
:: You may also define new goto targets if you have other lens memories defined
:: You should have a goto line for each Lens Memory you defined in your JVC projector

if %AR% LEQ 134 goto :AR133
if %AR% GEQ 135 if %AR% LEQ 166 goto :AR166
if %AR% GEQ 167 if %AR% LEQ 184 goto :AR178
if %AR% GEQ 185 if %AR% LEQ 199 goto :AR185
if %AR% GEQ 200 if %AR% LEQ 219 goto :AR200
if %AR% GEQ 220 if %AR% LEQ 232 goto :AR220
if %AR% GEQ 233 if %AR% LEQ 237 goto :AR235
if %AR% GEQ 238 goto :AR240

echo [ERROR] Aspect Ratio Value !AR! is unhandled!
goto :EOF


:: In each of the following Aspect Ratio procedures, change the trailing passed
:: value to one of the following values used by JVCControl:
:: D8 = Lens Memory / Installation Mode 1  1.78
:: D9 = Lens Memory / Installation Mode 2  2.40
:: DA = Lens Memory / Installation Mode 3  2.35
:: E5 = Lens Memory / Installation Mode 4  2.20
:: E6 = Lens Memory / Installation Mode 5  2.00
:: E7 = Lens Memory / Installation Mode 6  1.85
:: E8 = Lens Memory / Installation Mode 7  1.78
:: E9 = Lens Memory / Installation Mode 8  1.78
:: EA = Lens Memory / Installation Mode 9  1.78
:: EB = Lens Memory / Installation Mode 10 1.78
:: Example: start "" %JVCControl%EB will call "...\JVCControl.exe" EB to set Lens Memory 10

:AR133
start "" %JVCControl% D8
timeout /t 5 /nobreak
goto :EOF

:AR166
start "" %JVCControl% D8
timeout /t 5 /nobreak
goto :EOF

:AR178
start "" %JVCControl% D8
timeout /t 5 /nobreak
goto :EOF

:AR185
start "" %JVCControl% E7
timeout /t 5 /nobreak
goto :EOF

:AR235
start "" %JVCControl% DA
timeout /t 5 /nobreak
goto :EOF

:AR200
start "" %JVCControl% E6
timeout /t 5 /nobreak
goto :EOF

:AR220
start "" %JVCControl% E5
timeout /t 5 /nobreak
goto :EOF

:AR240
start "" %JVCControl% D9
timeout /t 5 /nobreak
goto :EOF

:FUNCTIONS
@REM FUNCTIONS AREA
goto :EOF
EXIT /B

:ReplaceText
::Replace Text In String
::USE:
:: CALL:ReplaceText "!OrginalText!" OldWordToReplace NewWordToUse  Result
::Example
::SET "MYTEXT=jump over the chair"
::  echo !MYTEXT!
::  call:ReplaceText "!MYTEXT!" chair table RESULT
::  echo !RESULT!
::
:: Remember to use the "! on the input text, but NOT on the Output text.
:: The Following is Wrong: "!MYTEXT!" !chair! !table! !RESULT!
:: ^^Because it has a ! around the chair table and RESULT
:: Remember to add quotes "" around the MYTEXT Variable when calling.
:: If you don't add quotes, it won't treat it as a single string
::
set "OrginalText=%~1"
set "OldWord=%~2"
set "NewWord=%~3"
call set OrginalText=%%OrginalText:!OldWord!=!NewWord!%%
SET %4=!OrginalText!
goto :EOF
Note that there might be a typo in your routine above, you use "OrginalText" instead of "OriginalText" but maybe it's intentional? In any case, the code works fine as it's consistent.

All works great, you can go ahead and implement.

Great work :)

User avatar
Pauven
Posts: 2794
Joined: Tue Dec 26, 2017 10:28 pm
Location: Atlanta, GA, USA
Contact:

Re: Custom IP control command according to aspect ratio

Post by Pauven » Thu Nov 09, 2023 7:35 pm

Manni wrote: Thu Nov 09, 2023 6:40 pm Note that there might be a typo in your routine above, you use "OrginalText" instead of "OriginalText" but maybe it's intentional? In any case, the code works fine as it's consistent.
Hah, figures! I copied/pasted that whole routine, found it online, so their typo came along for the ride. I barely skimmed it to ensure it did what I wanted.

Manni wrote: Thu Nov 09, 2023 6:40 pm Here is my modified test file
I like everything except for your particular AR values next to each mode, but only because someone else could get confused when mode 3 does 1.33 on their setup instead of 2.35. Not a big deal, but you could make it clearer that those are your particular values.

Also, I would think you'd want to evaluate the disc type too, to skip this logic for certain types, right? But maybe that's only in the future once JRMC had some built in capabilities.

Manni wrote: Thu Nov 09, 2023 6:40 pm All works great, you can go ahead and implement.
Excellent, thanks. I know today went quick, sorry to get your hopes up. You caught me on a good day. I think it will be a while before I actually implement. I'm about to start construction of my next pinball machine, and hope to enter it into a contest, entries due by end of year. With that and the holidays, is probably January at the earliest before I get back around to CMC.
President, Chameleon Consulting LLC
Author, Chameleon MediaCenter

Manni
Posts: 593
Joined: Wed May 22, 2019 5:27 am

Re: Custom IP control command according to aspect ratio

Post by Manni » Fri Nov 10, 2023 5:13 am

I did make a note in my post that these particular AR values were only for me, but you might have missed it. :)
I'm not sure you realise that mode 3 will not do anything related to 1.33 on anyone's setup unless they make it so. There is nothing that specifies which installation mode should be used for which A/R. So either people already have installation modes for each A/R (as I do) and they have to map it, or they don't and in that case they have to set-up each installation mode so that they work in hteir specific install, on their specific screen.
Historically, you could select the first two installation modes on the JVC remote directly, so a lot of people (myself included) would use the first two for the most often used ones, in my case 1.78 and 2.40. That's why I chose these specific slots, but each one will have their own implementation.
So most likely no two users will have the same modes for the same A/R, unless they start from scratch and follow yours arbitrarily.
If you wanted, you could use mine as default ones, they are as good as any.
Anyway, As I said, this batch file is for me, I would have added more comments/documentation otherwise.
Yes I'll add other things like disc type and HDR when the implementation is effective, depending on how jRiver has progressed by then and how much CMC allows to handle in the settings, as you had mentioned you had plans in this regards.
This was just a proof of concept to help you test, and confirm all was woring fine.
I noticed one issue if you use the same code for the CMC implementation, if you disable the third parameter, the 4th one becomes greyed out and it's not possible to access it. It makes sense to not allow a forth parameter if there is no third one, but in that case the 4th one should be set to disabled, not to the last value (I think).
I was expecting a build today, so I'm super disappointed that you're not already working on the implementation...
Joking of course :) I tried to keep up with you but I wasn't expecting you to start working on this so quickly, it will be ready when it's ready.
Who knows, you might be able to squeeze a rough implementation in before you start your pinball project, while all this is fresh. It feels like we've done 90% of the work at this stage, but I understand that the last 10% might tae a lot more time.
Thans again for considering implementing this, and looking forward to testing whenever you find the time to complete it.

Post Reply