summaryrefslogtreecommitdiffstats
path: root/launcher/src/main.cpp
diff options
context:
space:
mode:
authorTadao Tanikawa <tanikawa.tadao@jp.panasonic.com>2018-08-24 04:44:33 +0000
committerTadao Tanikawa <tanikawa.tadao@jp.panasonic.com>2018-08-24 10:58:38 +0000
commit9430d170c235ff75268db06d1ba32692dea0a65f (patch)
tree8524d3531c1388776a85f2953e0043018eb29259 /launcher/src/main.cpp
parentadfc55e6dd4b10b83aa35bab40698cbf7b496ec7 (diff)
This reverts commit 5fbb59e80e4f870a1badd694d2efcd8cd941cdfb. Bug-AGL: SPEC-1685 Change-Id: Idd71625415b79cff6ab76b6179236d946a5aab41 Signed-off-by: Tadao Tanikawa <tanikawa.tadao@jp.panasonic.com>
Diffstat (limited to 'launcher/src/main.cpp')
-rw-r--r--launcher/src/main.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/launcher/src/main.cpp b/launcher/src/main.cpp
index 5720203..91a1d80 100644
--- a/launcher/src/main.cpp
+++ b/launcher/src/main.cpp
@@ -124,8 +124,16 @@ int main(int argc, char *argv[])
homescreenHandler->init(port, token.toStdString().c_str());
homescreenHandler->set_event_handler(QLibHomeScreen::Event_TapShortcut, [layoutHandler, myname](json_object *object){
- qDebug("Surface %s got tapShortcut\n", myname.toStdString().c_str());
- layoutHandler->activateSurface(myname);
+ json_object *appnameJ = nullptr;
+ if(json_object_object_get_ex(object, "application_name", &appnameJ))
+ {
+ const char *appname = json_object_get_string(appnameJ);
+ if(myname == appname)
+ {
+ qDebug("Surface %s got tapShortcut\n", appname);
+ layoutHandler->activateSurface(myname);
+ }
+ }
});
QUrl bindingAddress;
='#n297'>297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448
{
    "openapi": "3.0.0",
    "info": {
        "description": "Audio high level API for AGL applications",
        "title": "audiohighlevel",
        "version": "1.0",
        "x-binding-c-generator": {
            "api": "ahl-4a",
            "version": 2,
            "prefix": "audiohlapi_",
            "postfix": "",
            "start": null,
            "onevent": "AhlOnEvent",
            "init": "AhlBindingInit",
            "scope": "",
            "private": false,
            "noconcurrency": false
        }
    },
    "servers": [
        {
            "url": "ws://{host}:{port}/api/audiohl",
            "description": "Audio high level API for AGL applications.",
            "variables": {
                "host": {
                    "default": "localhost"
                },
                "port": {
                    "default": "1234"
                }
            },
            "x-afb-events": [
                {
                    "$ref": "#/components/schemas/afb-event"
                }
            ]
        }
    ],
    "components": {
        "schemas": {
            "afb-reply": {
                "$ref": "#/components/schemas/afb-reply-v2"
            },
            "afb-event": {
                "$ref": "#/components/schemas/afb-event-v2"
            },
            "afb-reply-v2": {
                "title": "Generic response.",
                "type": "object",
                "required": ["jtype", "request"],
                "properties": {
                    "jtype": {
                        "type": "string",
                        "const": "afb-reply"
                    },
                    "request": {
                        "type": "object",
                        "required": ["status"],
                        "properties": {
                            "status": {
                                "type": "string"
                            },
                            "info": {
                                "type": "string"
                            },
                            "token": {
                                "type": "string"
                            },
                            "uuid": {
                                "type": "string"
                            },
                            "reqid": {
                                "type": "string"
                            }
                        }
                    },
                    "response": {
                        "type": "object"
                    }
                }
            },
            "afb-event-v2": {
                "type": "object",
                "required": ["jtype", "event"],
                "properties": {
                    "jtype": {
                        "type": "string",
                        "const": "afb-event"
                    },
                    "event": {
                        "type": "string"
                    },
                    "data": {
                        "type": "object"
                    }
                }
            },
            "endpoint_info": {
                "type": "object",
                "required": [ "endpoint_id", "type", "device_name", "device_uri" ],
                "properties": {
                    "endpoint_id": { "type": "int" },
                    "type": { "type": "enum" },
                    "device_name": { "type": "string" },
                    "device_uri_type": { "type": "string" }
                }
            },
            "stream_info": {
                "type": "object",
                "required": [ "stream_id", "state", "mute", "endpoint_info" ],
                "properties": {
                    "stream_id": { "type": "int" },
                    "state": { "type": "int" },
                    "mute": { "type": "int" },
                    "device_uri": { "type": "string" },
                    "$ref": "#/components/schemas/endpoint_info"
                }
            }
        },
        "x-permissions": {
            "streamcontrol": { "permission": "urn:AGL:permission:audio:public:streamcontrol"},
            "endpointcontrol": { "permission": "urn:AGL:permission:audio:public:endpointcontrol"},
            "audiostream": { "permission": "urn:AGL:permission:audio:public:audiostream"},
            "soundevent": {"permission": "urn:AGL:permission:audio:public:soundevent"}
        },
        "responses": {
            "200": {
                "description": "A complex object array response",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/afb-reply"
                        }
                    }
                }
            },
            "400": { "description": "Invalid arguments" }
        }
    },    
    "paths": {
        "/get_endpoints": {
            "description": "Retrieve array of available audio endpoints",
            "get": {
                "parameters": [
                    {
                        "in": "query",
                        "name": "audio_role",
                        "required": true,
                        "schema": { "type": "string" }
                    },
                    {
                        "in": "query",
                        "name": "endpoint_type",
                        "required": true,
                        "schema": { "type": "enum" }
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/200",
                        "response": {
                            "description": "Array of endpoint info structures",
                            "type": "array",
                            "items": { "$ref": "#/components/schemas/endpoint_info"}
                        }
                    },
                    "400": { "$ref": "#/components/responses/400" }
                }
            }
        },
        "/stream_open": {
            "description": "Request opening a stream",
            "get": {
                "x-permissions": { "$ref": "#/components/x-permissions/audiostream" },
                "parameters": [
                    {
                        "in": "query",
                        "name": "audio_role",
                        "required": true,
                        "schema": { "type": "string" }
                    },
                    {
                        "in": "query",
                        "name": "endpoint_type",
                        "required": true,
                        "schema": { "type": "enum" }
                    },
                    {
                        "in": "query",
                        "name": "endpoint_id",
                        "required": false,
                        "schema": { "type": "int" }
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/200",
                        "response": {
                            "description": "Stream information structure",
                            "$ref": "#/components/schemas/stream_info"
                        }
                    },
                    "400": { "$ref": "#/components/responses/400" }
                }
            }
        },
        "/stream_close": {
            "description": "Request closing a stream",
            "get": {
                "x-permissions": { "$ref": "#/components/x-permissions/audiostream" },
                "parameters": [
                    {
                        "in": "query",
                        "name": "stream_id",
                        "required": false,
                        "schema": { "type": "int" }
                    }
                ],
                "responses": {
                    "200": { "$ref": "#/components/responses/200" },
                    "400": { "$ref": "#/components/responses/400" }
                }
            }
        },
        "/set_stream_state": {
            "description": "Change stream active and/or mute state",
            "get": {
                "x-permissions": {
                    "$ref": "#/components/x-permissions/streamcontrol"
                },
                "parameters": [
                    {
                        "in": "query",
                        "name": "stream_id",
                        "required": false,
                        "schema": {"type": "int"}
                    },
                    {
                        "in": "query",
                        "name": "state",
                        "required": false,
                        "schema": {"type": "int"}
                    },
                    {
                        "in": "query",
                        "name": "mute",
                        "required": false,
                        "schema": {"type": "int"}
                    }
                ],
                "responses": {
                    "200": { "$ref": "#/components/responses/200" },
                    "400": { "$ref": "#/components/responses/400" }
                }
            }
        },
        "/get_stream_info": {
            "description": "Retrieve stream information",
            "get": {
                "parameters": [
                    {
                        "in": "query",
                        "name": "stream_id",
                        "required": true,
                        "schema": {"type": "int"}
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/200",
                        "response": {
                            "description": "Stream information structure",
                            "$ref": "#/components/schemas/stream_info"
                        }
                    },
                    "400": { "$ref": "#/components/responses/400" }
                }
            }
        },
        "/volume": {
            "description": "Set or get volume on endpoint",
            "get": {
                "x-permissions": { "$ref": "#/components/x-permissions/endpointcontrol" },
                "parameters": [
                    {
                        "in": "query",
                        "name": "endpoint_type",
                        "required": true,
                        "schema": { "type": "enum" }
                    },
                    {
                        "in": "query",
                        "name": "endpoint_id",
                        "required": true,
                        "schema": { "type": "int" }
                    },
                    {
                        "in": "query",
                        "name": "volume",
                        "required": false,
                        "schema": { "type": "string" }
                    }
                ],
                "responses": {
                    "200": { "$ref": "#/components/responses/200" },
                    "400": { "$ref": "#/components/responses/400" }
                }
            }
        },
        "/get_endpoint_info": {
            "description": "Retrieve endpoint information including its properties",
            "get": {
                "parameters": [
                    {
                        "in": "query",
                        "name": "endpoint_type",
                        "required": true,
                        "schema": { "type": "enum" }
                    },
                    {
                        "in": "query",
                        "name": "endpoint_id",
                        "required": true,
                        "schema": { "type": "int" }
                    }
                ],
                "responses": {
                    "200": { "$ref": "#/components/responses/200" },
                    "400": { "$ref": "#/components/responses/400" }
                }
            }
        },
        "/property": {
            "description": "Set/get endpoint property value",
            "get": {
                "x-permissions": { "$ref": "#/components/x-permissions/endpointcontrol" },
                "parameters": [
                    {
                        "in": "query",
                        "name": "endpoint_type",
                        "required": true,
                        "schema": { "type": "enum" }
                    },
                    {
                        "in": "query",
                        "name": "endpoint_id",
                        "required": true,
                        "schema": { "type": "int" }
                    },
                    {
                        "in": "query",
                        "name": "property_name",
                        "required": true,
                        "schema": { "type": "string" }
                    },
                    {
                        "in": "query",
                        "name": "value",
                        "required": false,
                        "schema": { "type": "string" }
                    }
                ],
                "responses": {
                    "200": { "$ref": "#/components/responses/200" },
                    "400": { "$ref": "#/components/responses/400" }
                }
            }
        },
        "/get_list_actions": {
            "description": "Retrieve a list of supported actions for a particular audio role",
            "get": {
                "parameters": [
                    {
                        "in": "query",
                        "name": "audio_role",
                        "required": true,
                        "schema": { "type": "string" }
                    }
                ],
                "responses": {
                    "200": { "$ref": "#/components/responses/200" },
                    "400": { "$ref": "#/components/responses/400" }
                }
            }
        },
        "/post_action": {
            "description": "Post sound or audio device related action event (extendable mechanism)",
            "get": {
                "x-permissions": { "$ref": "#/components/x-permissions/soundevent" },
                "parameters": [
                    {
                        "in": "query",
                        "name": "action_name",
                        "required": true,
                        "schema": { "type": "string" }
                    },
                    {
                        "in": "query",
                        "name": "audio_role",
                        "required": true,
                        "schema": { "type": "string" }
                    },
                    {
                        "in": "query",
                        "name": "media_name",
                        "required": false,
                        "schema": { "type": "string"}
                    },
                    {
                        "in": "query",
                        "name": "action_context",
                        "required": false,
                        "schema": { "type": "object" }
                    }
                ],
                "responses": {
                    "200": { "$ref": "#/components/responses/200" },
                    "400": { "$ref": "#/components/responses/400" }
                }
            }
        },
        "/event_subscription": {
            "description": "Subscribe to audio high level events",
            "get": {
                "parameters": [
                    {
                        "in": "query",
                        "name": "events",
                        "required": true,
                        "schema": { "type": "array",
                        "items": { "type": "string" }
                        }
                    },
                    {
                        "in": "query",
                        "name": "subscribe",
                        "required": true,
                        "schema": { "type": "int" }
                    }
                ],
                "responses": {
                    "200": { "$ref": "#/components/responses/200" },
                    "400": { "$ref": "#/components/responses/400" }
                }
            }
        }
    }
}