maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Multimedia (https://talk.maemo.org/forumdisplay.php?f=32)
-   -   [ANNOUNCE] Alpha release of Open Media Player (https://talk.maemo.org/showthread.php?t=72156)

gidzzz 2014-03-05 10:49

Re: [ANNOUNCE] Alpha release of Open Media Player
 
Quote:

Originally Posted by Android_808 (Post 1413753)
is omp able to play streams piped from stdout?

Nope, and it is impossible to take data from stdin and feed it directly to the renderer. I think the closest you can get is to use a named pipe and try to open it like a regular file. If it works, perhaps it could be automated.


Quote:

Originally Posted by freemangordon (Post 1415214)
@gidzzz - there is a long standing "feature" in OMP - trying to change the language while in playlist search mode (songs, etc) brings plyback window. That feature comes from https://gitorious.org/qt-mediaplayer...icator.cpp#L76

Now, my understanding is that no application should override system shortcuts unless really needed. Which is not the case here IMO.

I can't see anything wrong with language switching on my device. I did a few tests in the music window:
  • Search bar hidden -> Ctrl+Space opens Now Playing.
  • Search bar focused -> Ctrl+Space causes a notification saying "Input language switched to XXX" to appear.
  • Search bar visible, but not focused -> Ctrl+Space does nothing.
Am I misunderstanding something? Or where could the difference be coming from? I have not been messing with Qt libs.

freemangordon 2014-03-05 15:25

Re: [ANNOUNCE] Alpha release of Open Media Player
 
Quote:

Originally Posted by gidzzz (Post 1415522)

I can't see anything wrong with language switching on my device. I did a few tests in the music window:
[*]Search bar hidden -> Ctrl+Space opens Now Playing.

That one :)

Quote:

...[*]Search bar visible, but not focused -> Ctrl+Space does nothing.
That one too

Open Contacts for example, input language can be switched *before* you've typed anything. And that is more logical than OMP's behaviour, where you have to type something, switch the language, then clear what you've typed, then type again.

Not to say that a system-wide shortcut should not be overtaken by an application unless really needed. I don't see why OMP needs exactly ctrl-space for opening the "Now Playing" window. That one could be shift-space, shift-enter or ctrl-enter as well(or some other combo), without breaking language switching capability.

Quote:

Am I misunderstanding something? Or where could the difference be coming from?
The difference comes from the fact that OMP explicitly defines ctrl-space as application shortcut (see the link I posted in my previous post)

gidzzz 2014-03-05 17:24

Re: [ANNOUNCE] Alpha release of Open Media Player
 
Quote:

Originally Posted by freemangordon (Post 1415557)
Open Contacts for example, input language can be switched *before* you've typed anything. And that is more logical than OMP's behaviour, where you have to type something, switch the language, then clear what you've typed, then type again.

Not to say that a system-wide shortcut should not be overtaken by an application unless really needed. I don't see why OMP needs exactly ctrl-space for opening the "Now Playing" window. That one could be shift-space, shift-enter or ctrl-enter as well(or some other combo), without breaking language switching capability.

Now I see what you mean, but I wouldn't call it "overtaking" or "breaking something", as Contacts seems to be an exception here. Even Calendar, where pressing a letter key opens "New event" window with that letter typed, does not allow to change the input language unless an input field has the focus, let alone applications such as MicroB, the PDF viewer, or the stock media player.

Quote:

Originally Posted by freemangordon (Post 1415557)
The difference comes from the fact that OMP explicitly defines ctrl-space as application shortcut (see the link I posted in my previous post)

I think the difference comes from the fact that an application itself has to implement that behavior. For example, Ctrl+Space does nothing in Hamster Filer or cuteTube. That said, it is not just a matter of changing the shortcut, but also adding a new shortcut (although that should be pretty painless, as most windows share a custom common base class).

{Ctrl,Shift}+Enter are used for menus. I prefer most shortcuts with Ctrl rather than Shift, so I'd rather have Ctrl+P than Shift+Space. If there are no hard objections or better ideas, I think I can change all instances of Ctrl+Space to Ctrl+P (see http://wiki.maemo.org/Open_Media_Player#Controls for the list of affected contexts) and assign Ctrl+Space to toggle input language in most windows, of course provided I can find out how to do that (it doesn't look like it's as simple as calling something over D-Bus, any hints?). But doesn't that sound like a job for Qt, not individual applications?

freemangordon 2014-03-05 20:56

Re: [ANNOUNCE] Alpha release of Open Media Player
 
Quote:

Originally Posted by gidzzz (Post 1415565)
Now I see what you mean, but I wouldn't call it "overtaking" or "breaking something", as Contacts seems to be an exception here. Even Calendar, where pressing a letter key opens "New event" window with that letter typed, does not allow to change the input language unless an input field has the focus, let alone applications such as MicroB, the PDF viewer, or the stock media player.

My experience differs with yours - with all of the above applications, actually in every application I try - I can switch the input language no matter whether there is input filed focused or not, and no matter whether there is an input field at all. As long as ctrl-space is pressed, the language is switched. Excluding OMP ofc. I have ukeyboard installed, that might be the reason, though I doubt.

Try it:
1. open google in microb
2. click outside of the search field,
3. type something (so microb address field to appear and you to check your current language).
4. click somewhere on the page (so address field to disappear).
5. Press ctrl-space
6. go to 3

Quote:

I think the difference comes from the fact that an application itself has to implement that behavior.
I am afraid you don't grok what https://gitorious.org/qt-mediaplayer...icator.cpp#L76 does.

Code:

connect(new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Space), this), SIGNAL(activated()), this, SLOT(openWindow()));
Let me try to elaborate:

ctrl-space is a system-wide shortcut handled by hildon-input-method framework (if I am not mistaken) which switches the currently active input language for the hardware keyboard. The above code makes that sequence be handled by the application(or rather NowPlayingIndicator) itself *when* an object of class NowPlayingIndicator (or its parent) is active(visible). IIUC. So, HIM does not have any chance to switch the language. From Qt help:

http://qt-project.org/doc/qt-4.7/qshortcut.html

Code:

A shortcut is "listened for" by Qt's event loop when the shortcut's parent widget is receiving events.
Quote:

For example, Ctrl+Space does nothing in Hamster Filer or cuteTube.
Wrong (at least for cuteTube), ctrl-space switches input language in cuteTube (which is the expected behaviour as Qt interacts with HIM). Don't have Hamster Filer so can't test, but I bet it is the same there. And in every other Qt application.

Quote:

That said, it is not just a matter of changing the shortcut, but also adding a new shortcut (although that should be pretty painless, as most windows share a custom common base class).
{Ctrl,Shift}+Enter are used for menus. I prefer most shortcuts with Ctrl rather than Shift, so I'd rather have Ctrl+P than Shift+Space. If there are no hard objections or better ideas, I think I can change all instances of Ctrl+Space to Ctrl+P (see http://wiki.maemo.org/Open_Media_Player#Controls for the list of affected contexts)
It is up to you to decide that, I was just trying to give an example of possible replacements

Quote:

and assign Ctrl+Space to toggle input language in most windows, of course provided I can find out how to do that (it doesn't look like it's as simple as calling something over D-Bus, any hints?).
You should do nothing, Qt already does it for you, unless the application overrides it (see the above code)

Quote:

But doesn't that sound like a job for Qt, not individual applications?
Exactly. And Qt does its job pretty well given we don't oversmart it.

gidzzz 2014-03-05 22:38

Re: [ANNOUNCE] Alpha release of Open Media Player
 
I understand what QShortcut does and what you're saying, but until now (the example with MicroB) I thought that you have based your claims on not enough apps. I'll install ukeyboard and try some other things tomorrow if I can find a free moment. It would be nice if in the meantime also somebody else could share their observations.

Below are some applications that I've checked, I can't see any interesting pattern here: :(
  • the desktop -
  • MicroB -
  • Media player -
  • Calendar -
  • Photos -
  • Contacts +
  • Phone +
  • Maps -
  • Camera -
  • E-mail +
  • Conversations +
  • Calculator -
  • Settings -
  • Backup -
  • PDF readerer -
  • RSS -
  • File manager +
  • FApMan -
  • App manager -
  • cuteTube -
  • Hamster Filer -
  • Qalendar -
  • gpSP -
  • gpSP GUI -
  • Marble -

mr_pingu 2014-03-06 12:04

Re: [ANNOUNCE] Alpha release of Open Media Player
 
You should try with default mediaplayer, it only starts and stops playing: The ctrl button is fully ignored as normal space does the same!

freemangordon 2014-03-07 00:02

Re: [ANNOUNCE] Alpha release of Open Media Player
 
Quote:

Originally Posted by mr_pingu (Post 1415679)
You should try with default mediaplayer, it only starts and stops playing: The ctrl button is fully ignored as normal space does the same!

Could you be more specific to whom is that post pointed to?

mr_pingu 2014-03-07 07:53

Re: [ANNOUNCE] Alpha release of Open Media Player
 
Actually it is not pointed to anyone specific but you said that ctrl-space shouldn't be overriden by an application. Well, a good point, seems quite a good guideline and common sense. But, it's a non-existing real requirement as even the default player has not that behaviour and if you look at Gidzzz list, there are even more default application that dont follow that rule.

You, FMG, presented it as an Already existint rule but that's not the case, that rule doesn't exist. Though I agree it should be a rule, even if not all application allow that. It just is more logical; what if a application on desktop overrides all system shortcuts Like alt-tab, how should one switch an application?

So in short: That isnt an existing rule/guideline, but I agree it should be one

freemangordon 2014-03-07 08:02

Re: [ANNOUNCE] Alpha release of Open Media Player
 
Quote:

Originally Posted by mr_pingu (Post 1415776)
...But, it's a non-existing real requirement as even the default player has not that behaviour and if you look at Gidzzz list, there are even more default application that dont follow that rule.

Well, ctrl-space switches language here in default media player.

I wonder why is that difference (ukeyboard?).

Even if it is because of ukeyboard, I think we should treat it(the shortcut) as a stock system rule, because ukeyboard is the only way I know for non-stock languages to be supported.

mr_pingu 2014-03-07 08:38

Re: [ANNOUNCE] Alpha release of Open Media Player
 
Also on my second N900 that shortcut doesn't work. None of these have Ukeyboard installed. So I suppose UKeyboard somehow fixes that


All times are GMT. The time now is 16:31.

vBulletin® Version 3.8.8