OLD | NEW |
1 #ifndef __DEFINED__SkPdfSoundObjectDictionary | 1 #ifndef __DEFINED__SkPdfSoundObjectDictionary |
2 #define __DEFINED__SkPdfSoundObjectDictionary | 2 #define __DEFINED__SkPdfSoundObjectDictionary |
3 | 3 |
4 #include "SkPdfEnums_autogen.h" | 4 #include "SkPdfEnums_autogen.h" |
5 #include "SkPdfArray_autogen.h" | 5 #include "SkPdfArray_autogen.h" |
6 #include "SkPdfDictionary_autogen.h" | 6 #include "SkPdfDictionary_autogen.h" |
7 | 7 |
| 8 // Additional entries specific to a sound object |
8 class SkPdfSoundObjectDictionary : public SkPdfDictionary { | 9 class SkPdfSoundObjectDictionary : public SkPdfDictionary { |
9 public: | 10 public: |
10 virtual SkPdfObjectType getType() const { return kSoundObjectDictionary_SkPdfO
bjectType;} | 11 virtual SkPdfObjectType getType() const { return kSoundObjectDictionary_SkPdfO
bjectType;} |
11 virtual SkPdfObjectType getTypeEnd() const { return (SkPdfObjectType)(kSoundOb
jectDictionary_SkPdfObjectType + 1);} | 12 virtual SkPdfObjectType getTypeEnd() const { return (SkPdfObjectType)(kSoundOb
jectDictionary_SkPdfObjectType + 1);} |
12 public: | 13 public: |
13 virtual SkPdfSoundObjectDictionary* asSoundObjectDictionary() {return this;} | 14 virtual SkPdfSoundObjectDictionary* asSoundObjectDictionary() {return this;} |
14 virtual const SkPdfSoundObjectDictionary* asSoundObjectDictionary() const {ret
urn this;} | 15 virtual const SkPdfSoundObjectDictionary* asSoundObjectDictionary() const {ret
urn this;} |
15 | 16 |
16 private: | 17 private: |
17 virtual SkPdfALinkAnnotationDictionary* asALinkAnnotationDictionary() {return
NULL;} | 18 virtual SkPdfALinkAnnotationDictionary* asALinkAnnotationDictionary() {return
NULL;} |
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
514 | 515 |
515 public: | 516 public: |
516 private: | 517 private: |
517 public: | 518 public: |
518 SkPdfSoundObjectDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfOb
ject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {} | 519 SkPdfSoundObjectDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfOb
ject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {} |
519 | 520 |
520 virtual bool valid() const {return true;} | 521 virtual bool valid() const {return true;} |
521 | 522 |
522 SkPdfSoundObjectDictionary& operator=(const SkPdfSoundObjectDictionary& from)
{this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return
*this;} | 523 SkPdfSoundObjectDictionary& operator=(const SkPdfSoundObjectDictionary& from)
{this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return
*this;} |
523 | 524 |
| 525 /** (Optional) The type of PDF object that this dictionary describes; if present
, must be |
| 526 * Sound for a sound object. |
| 527 **/ |
| 528 bool has_Type() const { |
| 529 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Type"
, "", NULL)); |
| 530 } |
| 531 |
524 std::string Type() const { | 532 std::string Type() const { |
525 std::string ret; | 533 std::string ret; |
526 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Type", "",
&ret)) return ret; | 534 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Type", "",
&ret)) return ret; |
527 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 535 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
528 return ""; | 536 return ""; |
529 } | 537 } |
530 | 538 |
| 539 /** (Required) The sampling rate, in samples per second. |
| 540 **/ |
| 541 bool has_R() const { |
| 542 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "R", "
", NULL)); |
| 543 } |
| 544 |
531 double R() const { | 545 double R() const { |
532 double ret; | 546 double ret; |
533 if (DoubleFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "R", "", &
ret)) return ret; | 547 if (DoubleFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "R", "", &
ret)) return ret; |
534 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 548 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
535 return 0; | 549 return 0; |
536 } | 550 } |
537 | 551 |
| 552 /** (Optional) The number of sound channels. Default value: 1. (See implementati
on |
| 553 * note 101 in Appendix H.) |
| 554 **/ |
| 555 bool has_C() const { |
| 556 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "C", "
", NULL)); |
| 557 } |
| 558 |
538 long C() const { | 559 long C() const { |
539 long ret; | 560 long ret; |
540 if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "C", "", &re
t)) return ret; | 561 if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "C", "", &re
t)) return ret; |
541 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 562 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
542 return 0; | 563 return 0; |
543 } | 564 } |
544 | 565 |
| 566 /** (Optional) The number of bits per sample value per channel. Default value: 8
. |
| 567 **/ |
| 568 bool has_B() const { |
| 569 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "B", "
", NULL)); |
| 570 } |
| 571 |
545 long B() const { | 572 long B() const { |
546 long ret; | 573 long ret; |
547 if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "B", "", &re
t)) return ret; | 574 if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "B", "", &re
t)) return ret; |
548 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 575 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
549 return 0; | 576 return 0; |
550 } | 577 } |
551 | 578 |
| 579 /** (Optional) The encoding format for the sample data: |
| 580 * Raw Unspecified or unsigned values in the range 0 to 2B - 1 |
| 581 * Signed Twos-complement values |
| 582 * muLaw mu-law'encoded samples |
| 583 * ALaw A-law'encoded samples |
| 584 * Default value: Raw. |
| 585 **/ |
| 586 bool has_E() const { |
| 587 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "E", "
", NULL)); |
| 588 } |
| 589 |
552 std::string E() const { | 590 std::string E() const { |
553 std::string ret; | 591 std::string ret; |
554 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "E", "", &re
t)) return ret; | 592 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "E", "", &re
t)) return ret; |
555 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 593 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
556 return ""; | 594 return ""; |
557 } | 595 } |
558 | 596 |
| 597 /** (Optional) The sound compression format used on the sample data. (Note that
this is |
| 598 * separate from any stream compression specified by the sound object's Filter
entry; see |
| 599 * Table 3.4 on page 38 and Section 3.3, "Filters.") If this entry is absent, t
hen no sound |
| 600 * compression has been used; the data contains sampled waveforms to be played
at R |
| 601 * samples per second per channel. |
| 602 **/ |
| 603 bool has_CO() const { |
| 604 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "CO",
"", NULL)); |
| 605 } |
| 606 |
559 std::string CO() const { | 607 std::string CO() const { |
560 std::string ret; | 608 std::string ret; |
561 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "CO", "", &r
et)) return ret; | 609 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "CO", "", &r
et)) return ret; |
562 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 610 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
563 return ""; | 611 return ""; |
564 } | 612 } |
565 | 613 |
| 614 /** (Optional) Optional parameters specific to the sound compression format used
. |
| 615 * Note: At the time of publication, no standard values have been defined for t
he CO and CP |
| 616 * entries. |
| 617 **/ |
| 618 bool has_CP() const { |
| 619 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "CP",
"", NULL)); |
| 620 } |
| 621 |
566 SkPdfObject* CP() const { | 622 SkPdfObject* CP() const { |
567 SkPdfObject* ret; | 623 SkPdfObject* ret; |
568 if (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "CP", "",
&ret)) return ret; | 624 if (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "CP", "",
&ret)) return ret; |
569 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 625 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
570 return NULL; | 626 return NULL; |
571 } | 627 } |
572 | 628 |
573 }; | 629 }; |
574 | 630 |
575 #endif // __DEFINED__SkPdfSoundObjectDictionary | 631 #endif // __DEFINED__SkPdfSoundObjectDictionary |
OLD | NEW |