Page 1 of 1

Where does the GUI get the "Disc Information" from?

Posted: Fri Jan 12, 2024 1:45 pm
by davepusey
So when using the GUI interface, the panel on the right shows information about the currently inserted disk.

Example here...

Code: Select all

Disc Information
Label: STE_S1_D3
Timestamp: 2013-01-17 19:46:40
Protection: AACS v36
Data capacity: 42.32 Gb
Disc type: BD-ROM
Number of layers: 2
Channel bit length: 74,5 nm (25.0 GB max. per layer)
Where does this infomation come from, and why isn't it present when running the CLI interface... (notice there is the label, but no other information like timestamp or protection type, etc.)

Code: Select all

> "C:\Program Files (x86)\MakeMKV\makemkvcon64.exe" -r info disc:0

MSG:1005,0,1,"MakeMKV v1.17.5 win(x64-release) started","%1 started","MakeMKV v1.17.5 win(x64-release)"
DRV:0,2,999,12,"BD-RE HL-DT-ST BD-RE  WH16NS60 1.00 KLAM6E84217","STE_S1_D3","D:"
DRV:1,256,999,0,"","",""
DRV:2,256,999,0,"","",""
DRV:3,256,999,0,"","",""
DRV:4,256,999,0,"","",""
DRV:5,256,999,0,"","",""
DRV:6,256,999,0,"","",""
DRV:7,256,999,0,"","",""
DRV:8,256,999,0,"","",""
DRV:9,256,999,0,"","",""
DRV:10,256,999,0,"","",""
DRV:11,256,999,0,"","",""
DRV:12,256,999,0,"","",""
DRV:13,256,999,0,"","",""
DRV:14,256,999,0,"","",""
DRV:15,256,999,0,"","",""
MSG:1011,0,1,"Using LibreDrive mode (v06.3 id=4FBA32AEC678)","%1","Using LibreDrive mode (v06.3 id=4FBA32AEC678)"
MSG:3007,0,0,"Using direct disc access mode","Using direct disc access mode"
MSG:5085,0,0,"Loaded content hash table, will verify integrity of M2TS files.","Loaded content hash table, will verify integrity of M2TS files."
MSG:3307,0,2,"File 00021.mpls was added as title #0","File %1 was added as title #%2","00021.mpls","0"

Re: Where does the GUI get the "Disc Information" from?

Posted: Mon Jan 15, 2024 3:26 am
by jemima
Some of the strings that MakeMKV prints there seem to come from:
makemkvgui/src/scsiinfo.cpp
but I've just grep'ed that and haven't really looked deeper where it comes from (respectively whether it even comes from the open source part).

I'd also like to see that information in makemkvcon... and a --version switch. But I guess it's just not exported there as of now.

Cheers,
Jemima

Re: Where does the GUI get the "Disc Information" from?

Posted: Tue Jan 16, 2024 11:15 am
by davepusey
I had noticed scsiinfo.cpp too. I was just hoping there was already a way of getting this output directly on the command-line without me having to hack today my own little program to do it.

Re: Where does the GUI get the "Disc Information" from?

Posted: Wed Jan 17, 2024 4:07 pm
by davepusey
Turns out the QT framework (that the GUI is built with) supports the Windows accessibility interfaces, so was able to grab the info text via those APIs...

Code: Select all

using ManagedWinapi.Accessibility;
using ManagedWinapi.Windows;

private static string? GetInfoPanelText()
{
	IEnumerable<SystemWindow> windows = SystemWindow.AllToplevelWindows.Where(x => x.Process.ProcessName == "makemkv");
	foreach (SystemWindow window in windows)
	{
		SystemAccessibleObject sao = SystemAccessibleObject.FromWindow(window, AccessibleObjectID.OBJID_WINDOW);
		SystemAccessibleObject? saoInfoPanel = FindInfoPanel(sao);
		if (saoInfoPanel != null) return saoInfoPanel.Value;
	}
	return null;
}

private static SystemAccessibleObject? FindInfoPanel(SystemAccessibleObject sao)
{
	if ((sao.Name == "Info") && (sao.RoleString == "editable text")) return sao;
	foreach (SystemAccessibleObject saoChild in sao.Children)
	{
		SystemAccessibleObject? saoChildResult = FindInfoPanel(saoChild);
		if (saoChildResult != null) return saoChildResult;
	}
	return null;
}

Re: Where does the GUI get the "Disc Information" from?

Posted: Wed Jan 17, 2024 5:40 pm
by davepusey
Looks like it ate my screenshot showing working test program.

Let me try that again...

Image

Re: Where does the GUI get the "Disc Information" from?

Posted: Sat Jan 20, 2024 4:04 pm
by jemima
Nice... would still be good to have that directly via an option.

btw: Does anyone know about the meaning of the various Bus Encryption Flags values?

Re: Where does the GUI get the "Disc Information" from?

Posted: Sat Jan 20, 2024 4:56 pm
by davepusey
I think they are part of AACS, so probably somewhere in here

https://aacsla.com/wp-content/uploads/2 ... _0.921.pdf