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

Everything related to MakeMKV
Post Reply
davepusey
Posts: 5
Joined: Fri Jan 12, 2024 1:39 pm

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

Post 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"
jemima
Posts: 52
Joined: Fri Oct 06, 2023 1:16 am

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

Post 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
davepusey
Posts: 5
Joined: Fri Jan 12, 2024 1:39 pm

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

Post 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.
davepusey
Posts: 5
Joined: Fri Jan 12, 2024 1:39 pm

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

Post 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;
}
davepusey
Posts: 5
Joined: Fri Jan 12, 2024 1:39 pm

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

Post by davepusey »

Looks like it ate my screenshot showing working test program.

Let me try that again...

Image
jemima
Posts: 52
Joined: Fri Oct 06, 2023 1:16 am

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

Post 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?
davepusey
Posts: 5
Joined: Fri Jan 12, 2024 1:39 pm

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

Post by davepusey »

I think they are part of AACS, so probably somewhere in here

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