40-Pix-Player

Anwendungen, Tools, Userlibs und anderes nützliches.
Benutzeravatar
Lukaso
Beiträge: 720
Registriert: 08.09.2004 18:51
Wohnort: Oberkirch
Kontaktdaten:

Beitrag von Lukaso »

orange-blue hat geschrieben:Supa! Jetzt is das ding echt gut! Brauchst vielleicht auch ne Übersetztung auf Spanisch?
Das wäre Supa :allright:

MFG Lukaso
Nextgen Guild Wars Fanseite: Guild Wars Tactics (Pseudo-Admin + Developer)
"Das Fluchen ist die einzige Sprache, die jeder Programmierer beherrscht." - Unbekannter Autor
Benutzeravatar
ts-soft
Beiträge: 22292
Registriert: 08.09.2004 00:57
Computerausstattung: Mainboard: MSI 970A-G43
CPU: AMD FX-6300 Six-Core Processor
GraKa: GeForce GTX 750 Ti, 2 GB
Memory: 16 GB DDR3-1600 - Dual Channel
Wohnort: Berlin

Beitrag von ts-soft »

@Lukaso

Du solltest die Positionsspeicherung noch erweitern. Dein Player ist so klein, das wenn man die Bildschirmauflösung ändert, dieser evtl. nicht mehr erreichbar ist (befindet sich im Nirwana des Grafik-Speichers). Also eingestellte Auflösung feststellen, wenn nicht vorhanden neuer Eintrag z.B.

Code: Alles auswählen

[800x600]
x=150
y=100
Bei dieser Gelegenheit vielleicht gleich noch den aktuellen Desktop mit speichern (für Mehr-Monitorbetrieb). Falls ein Monitor nicht bereit ist

Ansonsten :allright:
PureBasic 5.73 LTS | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Nutella hat nur sehr wenig Vitamine. Deswegen muss man davon relativ viel essen.
Bild
Benutzeravatar
Lukaso
Beiträge: 720
Registriert: 08.09.2004 18:51
Wohnort: Oberkirch
Kontaktdaten:

Beitrag von Lukaso »

ts-soft hat geschrieben:Bei dieser Gelegenheit vielleicht gleich noch den aktuellen Desktop mit speichern (für Mehr-Monitorbetrieb). Falls ein Monitor nicht bereit ist.
Wenn du mir sagst, wie ich den Desktop bestimmen kann, wo der Player beendet wurde und diesen wieder dorthin zurücksetzen kann, würde ich dies implentieren :wink:

MFG Lukaso
Nextgen Guild Wars Fanseite: Guild Wars Tactics (Pseudo-Admin + Developer)
"Das Fluchen ist die einzige Sprache, die jeder Programmierer beherrscht." - Unbekannter Autor
Benutzeravatar
ts-soft
Beiträge: 22292
Registriert: 08.09.2004 00:57
Computerausstattung: Mainboard: MSI 970A-G43
CPU: AMD FX-6300 Six-Core Processor
GraKa: GeForce GTX 750 Ti, 2 GB
Memory: 16 GB DDR3-1600 - Dual Channel
Wohnort: Berlin

Beitrag von ts-soft »

@Lukaso
Wenn du mir sagst, wie ich den Desktop bestimmen kann, wo der Player beendet wurde und diesen wieder dorthin zurücksetzen kann, würde ich dies implentieren
Habe leider im Moment auch keine Möglichkeit dies zu Testen. Vielleicht kann ja jemand anderes hier helfen.
Ansonsten auf jeden Fall erstmal die jeweilige Auflösung mit speichern. Wenn sich der Player ausserhalb des Bildschirms befindet kann man in sonst nur per Taskmanager beenden. Multiuser-Unterstützung, indem Du die Ini z.B. unter "ApplicationData\Lukaso\*.ini" speicherst wäre auch Sinnvoll.

Hoffe es gibt bald mal wieder ein Update Deines Players.
PureBasic 5.73 LTS | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Nutella hat nur sehr wenig Vitamine. Deswegen muss man davon relativ viel essen.
Bild
Benutzeravatar
bluejoke
Beiträge: 1244
Registriert: 08.09.2004 16:33
Kontaktdaten:

Beitrag von bluejoke »

HeyHo!

Ein Feature-Request: Audio-CDs sollte der Player auch abspielen können,
außerdem sollte man ihn einfach als Standardplayer eintragen können!

Simon
Ich bin Ausländer - fast überall
Windows XP Pro SP2 - PB 4.00
Benutzeravatar
mueckerich
Beiträge: 220
Registriert: 13.09.2004 11:33
Wohnort: Am schönsten Flecken der Erde, zwischen PC und Motorrad

Beitrag von mueckerich »

@Lukaso
Wenn du mir sagst, wie ich den Desktop bestimmen kann, wo der Player beendet wurde und diesen wieder dorthin zurücksetzen kann, würde ich dies implentieren
Hab im Englischen Forum einen Code gefunden, mit dem Du die Infos für den jeweiligen Desktop auslesen kannst. Unter anderem finden sich da auch PosX und PosY Werte, an denen der Bildschirm anfängt. Damit und der Fensterposition müsste sich feststellen lassen, auf welchen Desktop das Progrqamm läuft.

Hier der Code:

Code: Alles auswählen

; purebasic survival guide 
; multi_monitor_2.pb - 30.12.2003 ejn (blueznl) 
; http://www.xs4all.nl/~bluez/datatalk/pure1.htm 
; 
; - how to detect multiple monitors and their relative position to each other 
; - EndumDisplayMonitors_() 
; - EnumDisplayDevices_() 
; - EnumDisplaySettings_() 
; - MonitorFromPoint_() 
; - GetMonitorInfo_() 
; 
; constants / structs for multi monitor handling 
; 
#SM_XVIRTUALSCREEN = 76 ; x-coordinate of left upper corner of total display area 
#SM_YVIRTUALSCREEN = 77 ; same for y 
#SM_CXVIRTUALSCREEN = 78 ; width 
#SM_CYVIRTUALSCREEN = 79 ; height 
#SM_CMONITORS = 80 ; number of monitors 
#SM_SAMEDISPLAYFORMAT = 81 ; identical sizing of all screens 
; 
#MONITOR_DEFAULTTONULL = 0 
#MONITOR_DEFAULTTOPRIMARY = 1 
#MONITOR_DEFAULTTONEAREST = 2 
; 
#SM_XVIRTUALSCREEN = 76 ; x-coordinate of left upper corner of total display area 
#SM_YVIRTUALSCREEN = 77 ; same for y 
#SM_CXVIRTUALSCREEN = 78 ; width 
#SM_CYVIRTUALSCREEN = 79 ; height 
#SM_CMONITORS = 80 ; number of monitors 
#SM_SAMEDISPLAYFORMAT = 81 ; identical sizing of all screens 
; 
#DISPLAY_DEVICE_ATTACHED_TO_DESKTOP = $1 
#DISPLAY_DEVICE_MULTI_DRIVER = $2 
#DISPLAY_DEVICE_PRIMARY_DEVICE = $4 
#DISPLAY_DEVICE_MIRRORING_DRIVER = $8 
#DISPLAY_DEVICE_VGA_COMPATIBLE = $10 
#DISPLAY_DEVICE_REMOVABLE = $20 
#DISPLAY_DEVICE_MODESPRUNED = $8000000 
#DISPLAY_DEVICE_REMOTE = $4000000 
#DISPLAY_DEVICE_DISCONNECT = $2000000 
#DISPLAY_DEVICE_ACTIVE = $1 
#DISPLAY_DEVICE_ATTACHED = $2 
; 
#CCHDEVICENAME = 32 
#CCHFORMNAME = 32 
; 
#ENUM_CURRENT_SETTINGS = -1 
#ENUM_REGISTRY_SETTINGS = -2 
; 
#MONITOR_DEFAULTTONULL = 0 
#MONITOR_DEFAULTTOPRIMARY = 1 
#MONITOR_DEFAULTTONEAREST = 2 
; 
Structure MONITORINFO ; used to retrieve monitor info 
cb.l ; size of structure (fill before using) 
m_x1.l ; rectangle, monitor coords x1/y1/x2/y2 
m_y1.l 
m_x2.l 
m_y2.l 
w_x1.l ; rectangle, work area coords (?) 
w_y1.l 
w_x2.l 
w_y2.l 
flags.l 
EndStructure 
; 
Structure MONITORINFOEX ; superset of MONITORINFO with added string for devicename 
cb.l 
m_x1.l 
m_y1.l 
m_x2.l 
m_y2.l 
w_x1.l 
w_y1.l 
w_x2.l 
w_y2.l 
flags.l 
name.b[32] ; #CCHDEVICENAME = 32 
EndStructure 
; 
Structure DISPLAY_DEVICE ; used to retrieve monitor and device info 
cb.l ; length of struct 
DeviceName.b[32] 
DeviceString.b[128] 
StateFlags.l 
DeviceID.b[128] 
DeviceKey.b[128] 
EndStructure 
; 
Structure x_monitorinfo ; used to store monitor info 
n.l ; sequential number 
hnd.l ; handle 
x.l ; x-position 
y.l ; y-position 
w.l ; width 
h.l ; height 
d.l ; colour depth (bits) 
f.l ; frequency 
name.s ; devicename (i want my fixed length strings!) 
flags.l ; status of the device 
EndStructure 
; 
x_monitor_n.l = 0 ; number of monitors is... zero? :-) 
NewList x_monitor.x_monitorinfo() ; info on monitors 
x_desktop.x_monitorinfo ; info on desktop 

Procedure x_monitor_monitorenumproc(WindowID, Message, WPARAM, LPARAM) 
; 
; store on each call the monitor handle in the x_monitor() list 
; called by windows in callback as set up in x_monitor_detect() by the api EnumDisplayMonitors_() 
; also known as MonitorEnumProc 
; 
AddElement(x_monitor()) 
x_monitor()\hnd = WindowID 
; 
ProcedureReturn #PB_ProcessPureBasicEvents 
EndProcedure 

Procedure.l x_monitor_detect() 
Protected info.MONITORINFOEX, device.DISPLAY_DEVICE, n.l 
Global x_retval.l, x_monitor_n.l, x_desktop.x_monitorinfo 
Global x_monitor_samedisplayformat.l 
; 
; *** detect number of screens and retrieve their properties 
; 
; in: 
; retval: 
; out: x_monitor_n.l - number of screens 
; x_desktop_w.l - desktop width 
; x_desktop_h.l - desktop height 
; 
; GetSystemMetrics_() 
; 
; provides quite a bit info on display adapters, screens etc. but does not provide info 
; per monitor / device on multi monitor setups 
; 
; x_monitor_n = GetSystemMetrics_(#SM_CMONITORS) 
; x_monitor_samedisplayformat.l = GetSystemMetrics_(#SM_SAMEDISPLAYFORMAT) 
; 
x_desktop\w = GetSystemMetrics_(#SM_CXVIRTUALSCREEN) 
x_desktop\h = GetSystemMetrics_(#SM_CYVIRTUALSCREEN) 
; 
; Debug "same display format on all screens (0 = no)" 
; Debug x_monitor_samedisplayformat 
; Debug "counted using getsystemmetrics" 
; Debug x_monitor_n 
; 
; EnumDisplayMonitors() 
; 
; returns monitors overlapping a given rectangle, including pseudo / mirror monitors! 
; after the call, for each monitor a handle will be stored in x_monitor()\hnd 
; this can be used to obtain more information using GetMonitorInfo_() 
; flags returned are different from EnumDisplayDevices() 
; 
; ClearList(x_monitor()) 
; EnumDisplayMonitors_(0,0,@x_monitor_monitorenumproc(),0) ; call the function 
; info.MONITORINFOEX ; create a struct for GetMonitorInfo_() 
; info\cb = SizeOf(info) ; length of struct (important for MONITORINFO vs. MONITORINFOEX) 
; x_monitor_n = 0 ; nr. of monitors 
; ResetList(x_monitor()) ; reset and... 
; While NextElement(x_monitor()) ; go through the list 
; x_monitor_n = x_monitor_n+1 
; x_monitor()\n = x_monitor_n ; sequential number 
; GetMonitorInfo_(x_monitor()\hnd,@info) ; get info on the monitor 
; x_monitor()\x = info\m_x1 
; x_monitor()\y = info\m_y1 
; x_monitor()\w = info\m_x2 - info\m_x1 
; x_monitor()\h = info\m_y2 - info\m_y1 
; x_monitor()\name = PeekS(@info\name,32) ; i want my fixed length strings! 
; Wend 
; ; 
; Debug "counted using enumdisplaymonitors" 
; Debug x_monitor_n 
; 
; EnumDisplayDevices() 
; 
; walks through all available devices, retrieve names and flags 
; by using the returned flags all 'non-real' monitors can be filtered out 
; 
device.DISPLAY_DEVICE ; to store results from EnumDisplayDevices_() 
device\cb = SizeOf(DISPLAY_DEVICE) 
settings.DEVMODE ; to store results from EnumDisplaySettings_() 
settings\dmSize = SizeOf(settings) ; DEVMODE is declared in purebasic itself 
settings\dmDriverExtra = 0 
; 
ClearList(x_monitor()) 
n.l = 0 
x_monitor_n = 0 
While EnumDisplayDevices_(0,n,@device,0) > 0 ; check all devices 
n = n+1 
; 
; the StateFlags field in the filled struct contains information on the device / monitor 
; some values to check with (not all cards / drivers support all functions): 
; 
; #DISPLAY_DEVICE_ATTACHED_TO_DESKTOP - in use and part of the desktop 
; #DISPLAY_DEVICE_PRIMARY_DEVICE - primary device 
; #DISPLAY_DEVICE_VGA_COMPATIBLE - none reported 
; #DISPLAY_DEVICE_MULTI_DRIVER 
; #DISPLAY_DEVICE_ACTIVE 
; #DISPLAY_DEVICE_ATTACHED 
; 
If device\StateFlags & #DISPLAY_DEVICE_ATTACHED_TO_DESKTOP ; check if it's part of the desktop 
; 
; if a device is part of the desktop, additional information can be retrieved using 
; EnumDisplaySettings_() with the device name 
; 
If EnumDisplaySettings_(@device\DeviceName,#ENUM_CURRENT_SETTINGS,@settings) > 0 
; 
; first store some info found via EnumDisplayDevices_() 
; 
AddElement(x_monitor()) 
x_monitor_n = x_monitor_n+1 
x_monitor()\n = x_monitor_n 
x_monitor()\name = PeekS(@device\DeviceName,32) ; i want my fixed length strings! 
x_monitor()\flags = device\StateFlags 
; 
; and more stuff found via EnumDisplaySettings_() 
; 
x_monitor()\f = settings\dmDisplayFrequency 
x_monitor()\d = settings\dmBitsPerPel 
x_monitor()\w = settings\dmPelsWidth 
x_monitor()\h = settings\dmPelsHeight 
x_monitor()\x = PeekL(@settings\dmOrientation) ; the default definition in purebasic didn't include the onion, well, this works as well 
x_monitor()\y = PeekL(@settings\dmPaperLength) 

; 
; still, the handle is missing, so find that one using a point that is somewhere on the monitor 
; 
x_monitor()\hnd = MonitorFromPoint_(x_monitor()\x,x_monitor()\y,#MONITOR_DEFAULTTONULL) 
; 
EndIf 
EndIf 
Wend 
; 
; Debug "counted using enumdisplaydevices" 
; Debug x_monitor_n 
; 
x_retval = x_monitor_n 
ProcedureReturn x_retval 
EndProcedure 

x_monitor_detect() 

ResetList(x_monitor()) 
While NextElement(x_monitor()) 
Debug "" 
Debug "monitor "+Str(x_monitor()\n) 
If x_monitor()\flags & #DISPLAY_DEVICE_PRIMARY_DEVICE 
Debug "primary display" 
EndIf 
Debug "name "+x_monitor()\name 
Debug "handle "+Str(x_monitor()\hnd) 
Debug "pos x "+Str(x_monitor()\x) 
Debug "pos y "+Str(x_monitor()\y) 
Debug "width "+Str(x_monitor()\w) 
Debug "height "+Str(x_monitor()\h) 
Debug "depth "+Str(x_monitor()\d) 
Debug "refresh "+Str(x_monitor()\f) 
Wend 
Das kommt zu Beispiel bei meinem System raus:
.
  • monitor 1
    name \\.\DISPLAY1
    handle 65539
    pos x 1600
    pos y 224
    width 1024
    height 768
    depth 32
    refresh 70
    monitor 2
    primary display
    name \\.\DISPLAY2
    handle 65537
    pos x 0
    pos y 0
    width 1600
    height 1200
    depth 32
    refresh 75
Wie gesagt der Code ist nicht von mir. Vielleicht hilft Dir das weiter
"Wenn Sie glauben, mich verstanden zu haben, dann habe ich mich falsch ausgedrückt" ( Alan Greenspan)
Benutzeravatar
nicolaus
Moderator
Beiträge: 1175
Registriert: 11.09.2004 13:09
Kontaktdaten:

Beitrag von nicolaus »

refresh 70 tun dir da nich nach 30 min die augen weh ebi einer solch niedrigen refreshrate?
Benutzeravatar
Andre
PureBasic Team
Beiträge: 1765
Registriert: 11.09.2004 16:35
Computerausstattung: MacBook Core2Duo mit MacOS 10.6.8
Lenovo Y50 i7 mit Windows 10
Wohnort: Saxony / Deutscheinsiedel
Kontaktdaten:

Beitrag von Andre »

nicolaus hat geschrieben:refresh 70 tun dir da nich nach 30 min die augen weh ebi einer solch niedrigen refreshrate?
Muss ja nicht, bei Verwendung eines TFT-Monitors sind ja durchaus auch 60 Hz üblich... :mrgreen:
Bye,
...André
(PureBasicTeam::Docs - PureArea.net | Bestellen:: PureBasic | PureVisionXP)
Benutzeravatar
nicolaus
Moderator
Beiträge: 1175
Registriert: 11.09.2004 13:09
Kontaktdaten:

Beitrag von nicolaus »

Andre hat geschrieben:
nicolaus hat geschrieben:refresh 70 tun dir da nich nach 30 min die augen weh ebi einer solch niedrigen refreshrate?
Muss ja nicht, bei Verwendung eines TFT-Monitors sind ja durchaus auch 60 Hz üblich... :mrgreen:
ups da hatte ich garnich drann gedacht das es ja auch die flachen dinger gibt wo ich noch immer keinen von hab... *träum* :wink:
Benutzeravatar
mueckerich
Beiträge: 220
Registriert: 13.09.2004 11:33
Wohnort: Am schönsten Flecken der Erde, zwischen PC und Motorrad

Beitrag von mueckerich »

@Andre:
Muss ja nicht, bei Verwendung eines TFT-Monitors sind ja durchaus auch 60 Hz üblich...
Exaktomente!!! Sind nämlich TFT. :allright: :mrgreen:
Zuletzt geändert von mueckerich am 23.01.2005 20:35, insgesamt 1-mal geändert.
"Wenn Sie glauben, mich verstanden zu haben, dann habe ich mich falsch ausgedrückt" ( Alan Greenspan)
Antworten