content
stringlengths
10
4.9M
def motivational_sentences(): if not Authentication(session).is_signed_in(): return redirect("/LogIn") return render_template( "basic/motivationwall.html", )
Benchmark Pashto Handwritten Character Dataset and Pashto Object Character Recognition (OCR) Using Deep Neural Network with Rule Activation Function In the area of machine learning, different techniques are used to train machines and perform different tasks like computer vision, data analysis, natural language processing, and speech recognition. Computer vision is one of the main branches where machine learning and deep learning techniques are being applied. Optical character recognition (OCR) is the ability of a machine to recognize the character of a language. Pashto is one of the most ancient and historical languages of the world, spoken in Afghanistan and Pakistan. OCR application has been developed for various cursive languages like Urdu, Chinese, and Japanese, but very little work is done for the recognition of the Pashto language. When it comes to handwritten character recognition, it becomes more difficult for OCR to recognize the characters as every handwritten character’s shape is influenced by the writer’s hand motion dynamics. The reason for the lack of research in Pashto handwritten character data as compared to other languages is because there is no benchmark dataset available for experimental purposes. This study focuses on the creation of such a dataset, and then for the evaluation purpose, a machine is trained to correctly recognize unseen Pashto handwritten characters. To achieve this objective, a dataset of 43000 images was created. Three Feed Forward Neural Network models with backpropagation algorithm using different Rectified Linear Unit (ReLU) layer configurations (Model 1 with 1-ReLU Layer, Model 2 with 2-ReLU layers, and Model 3 with 3-ReLU Layers) were trained and tested with this dataset. The simulation shows that Model 1 achieved accuracy up to 87.6% on unseen data while Model 2 achieved an accuracy of 81.60% and 3% accuracy, respectively. Similarly, loss (cross-entropy) was the lowest for Model 1 with 0.15 and 3.17 for training and testing, followed by Model 2 with 0.7 and 4.2 for training and testing, while Model 3 was the last with loss values of 6.4 and 3.69. The precision, recall, and f-measure values of Model 1 were better than those of both Model 2 and Model 3. Based on results, Model 1 (with 1 ReLU activation layer) is found to be the most efficient as compared to the other two models in terms of accuracy to recognize Pashto handwritten characters.
#include<cstdio> #include<iostream> #include<cstring> #include<algorithm> #include<cmath> #include<string> #include<queue> using namespace std; long long f[200005]; int main() { ios::sync_with_stdio(false); int n; cin>>n; int num=n/2; for(int i=1;i<=n;i++) { cin>>f[i]; } for(int i=1;i<=num;i+=2) { swap(f[i],f[n-i+1]); } cout<<f[1]; for(int i=2;i<=n;i++) { cout<<" "<<f[i]; } cout<<endl; } // 1 2 3 4 //[2, 3, 9, 6, 7, 1, 4]. //[4, 1, 7, 6, 9, 3, 2]. 1 //[4, 3, 9, 6, 7, 1, 2]. 2 //[4, 3, 7, 6, 9, 1, 2]. 3 //[4, 3, 7, 6, 9, 1, 2]. 4 //1 2 3 4 4 3 2 1 //6 1 4 2 5 6 9 2 //2 1 6 2 5 4 9 6
def on_socket_open(self, ws): self.ws = ws
<reponame>pinchuk-dmitriy/EPAM package PageObject; import org.openqa.selenium.JavascriptExecutor; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.PageFactory; import org.openqa.selenium.support.ui.ExpectedCondition; import org.openqa.selenium.support.ui.ExpectedConditions; import org.openqa.selenium.support.ui.WebDriverWait; public class StoneIslandHomePage extends AbstractPage { private static final String HOMEPAGE_URL = "https://www.stoneisland.com/ru"; @FindBy(xpath = "//*[@id='slot_54446']/descendant-or-self::div[@class='ctabutton']") private WebElement ToComeInButton; public StoneIslandHomePage(WebDriver driver) { super(driver); } public StoneIslandHomePage openPage() { driver.get(HOMEPAGE_URL); new WebDriverWait(driver, WAIT_TIMEOUT_SECONDS) .until(jQueryAJAXCompleted()); return this; } public StoneIslandAndSupremePage goToPageWithProducts() { new WebDriverWait(driver, WAIT_TIMEOUT_SECONDS) .until(ExpectedConditions.elementToBeClickable(ToComeInButton)) .click(); return new StoneIslandAndSupremePage(driver); } }
/** * @author Marcin Grobelak */ public class ScoreCalculator { public static void setScore(List<Frame> frames) { int index = frames.size() - 1; Frame last = frames.get(index); if (!last.isFullPointer()) { last.setScore(last.getSumOfRolls()); } if (frames.size() >= 2) { Frame previous = frames.get(index - 1); if (last.isFinal()) { if (previous.isStrike() && previous.getScore() == null && last.getSecondRoll() != null) { previous.setScore(10 + last.getSumOfRolls()); return; } if (last.isClosed()) { last.setScore(last.getSumOfRolls()); return; } } if (frames.size() >= 3) { Frame antepenultimate = frames.get(index - 2); if (antepenultimate.isStrike() && previous.isStrike()) { if (last.isStrike()) { antepenultimate.setScore(30); return; } antepenultimate.setScore(20 + last.getFirstRoll()); if (last.getSumOfRolls() != null) { previous.setScore(10 + last.getSumOfRolls()); } return; } } if (previous.isStrike() && !last.isStrike()) { if (last.getSumOfRolls() != null) { previous.setScore(10 + last.getSumOfRolls()); } return; } if (previous.isSpare() && last.isStrike()) { previous.setScore(20); return; } if (previous.isSpare() && !last.isFullPointer()) { previous.setScore(10 + last.getFirstRoll()); } } } }
// Read the data from the given reader and parse it as a slice of strings, where we assume strings are separated by // whitespace or newlines. All extra whitespace and empty lines are ignored. func parseSliceFromReader(reader io.Reader) ([]string, error) { out := []string{} scanner := bufio.NewScanner(reader) for scanner.Scan() { words := strings.Fields(scanner.Text()) for _, word := range words { text := strings.TrimSpace(word) if text != "" { out = append(out, text) } } } err := scanner.Err() return out, errors.WithStackTrace(err) }
/* strip off surrounding delimiters around variables */ char *process_var(const char *var) { const char *orig = var; int len = strlen(var); if (*orig == '@' || *orig == '$') { orig++; len--; } else { PERROR("ASSERT: Found var '%s' without variable prefix\n", var); return NULL; } if (*orig == '{') { orig++; len--; if (orig[len - 1] != '}') { PERROR("ASSERT: No matching '}' in variable '%s'\n", var); return NULL; } else len--; } return strndup(orig, len); }
<gh_stars>0 import config from "../config"; import session from "express-session"; import genuuid from "uuid/v4"; import { SessionMiddleware, SessionStore } from "ch-node-session-handler"; import Redis from "ioredis"; import { RequestHandler } from "express"; // Get stubbed cookie and session middleware for node environments // or use CH session middleware for production const getSessionMiddleware = function(): RequestHandler { let sessionMiddleware; if (process.env.NODE_ENV === "development") { sessionMiddleware = session({ name: config.session.cookieName, secret: config.session.cookieSecret, genid: function() { return genuuid(); }, cookie: { secure: config.session.cookieSecure === "1", maxAge: config.session.timeOut * 1000, httpOnly: true, domain: config.session.cookieDomain, path: "/" }, resave: false, saveUninitialized: true, }) } else { const sessionStore = new SessionStore(new Redis(`redis://${config.session.cacheServer}`)); sessionMiddleware = SessionMiddleware({ cookieName: config.session.cookieName, cookieSecret: config.session.cookieSecret }, sessionStore); } return sessionMiddleware; } export default getSessionMiddleware;
The unit of time, the second, was at one time considered to be the fraction 1/86 400 of the mean solar day. The exact definition of "mean solar day" was left to the astronomers. However measurements showed that irregularities in the rotation of the Earth made this an unsatisfactory definition. In order to define the unit of time more precisely, the 11th CGPM (1960, Resolution 9) adopted a definition given by the International Astronomical Union based on the tropical year 1900. Experimental work, however, had already shown that an atomic standard of time, based on a transition between two energy levels of an atom or a molecule, could be realized and reproduced much more accurately. Considering that a very precise definition of the unit of time is indispensable for science and technology, the 13th CGPM (1967/68, Resolution 1) replaced the definition of the second by the following: The second is the duration of 9 192 631 770 periods of the radiation corresponding to the transition between the two hyperfine levels of the ground state of the caesium 133 atom. It follows that the hyperfine splitting in the ground state of the caesium 133 atom is exactly 9 192 631 770 hertz, (hfs Cs) = 9 192 631 770 Hz. At its 1997 meeting the CIPM affirmed that: This definition refers to a caesium atom at rest at a temperature of 0 K. This note was intended to make it clear that the definition of the SI second is based on a caesium atom unperturbed by black body radiation, that is, in an environment whose thermodynamic temperature is 0 K. The frequencies of all primary frequency standards should therefore be corrected for the shift due to ambient radiation, as stated at the meeting of the Consultative Committee for Time and Frequency in 1999. The symbol, (hfs Cs), is used to denote the frequency of the hyperfine transition in the ground state of the caesium atom.
<filename>Engine_dw-job-scheduler/src/main/java/com/distributedworkflowengine/jobscheduler/config/RedisConfig.java package com.distributedworkflowengine.jobscheduler.config; import org.apache.log4j.Logger; import org.springframework.beans.factory.annotation.Value; import org.springframework.cache.annotation.CacheConfig; import org.springframework.cache.annotation.CachingConfigurerSupport; import org.springframework.cache.annotation.EnableCaching; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.data.redis.cache.RedisCacheManager; import org.springframework.data.redis.connection.jedis.JedisConnectionFactory; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.serializer.RedisSerializer; import org.springframework.data.redis.serializer.StringRedisSerializer; import com.fasterxml.jackson.databind.ObjectMapper; // Redis Configuration @Configuration @EnableCaching public class RedisConfig extends CachingConfigurerSupport { private static final Logger log = Logger.getLogger(CacheConfig.class); // Constructs a new JedisConnectionFactory instance with default settings @Value("${spring.redis.bootstrap-servers}") private String redisserver; @Bean public JedisConnectionFactory redisConnectionFactory() { JedisConnectionFactory redisConnectionFactory = new JedisConnectionFactory(); // redisConnectionFactory.setHostName("172.23.238.159"); redisConnectionFactory.setHostName(redisserver); redisConnectionFactory.setPort(6379); return redisConnectionFactory; } //Constructs a RedisTemplate @Bean public RedisTemplate<String, String> redisTemplate() { RedisTemplate<String, String> rt = new RedisTemplate<>(); rt.setConnectionFactory(redisConnectionFactory()); rt.setKeySerializer(new StringRedisSerializer()); rt.setValueSerializer(new StringRedisSerializer()); return rt; } //Constructs an objectMapper @Bean public ObjectMapper objectMapper() { return new ObjectMapper(); } //Constructs a RedisCacheManager @Bean public RedisCacheManager cacheManager() { RedisCacheManager rcm = new RedisCacheManager(redisTemplate()); rcm.setDefaultExpiration(300); rcm.setTransactionAware(true); return rcm; } }
def pydeps2reqs(deps): reqs = defaultdict(set) baseprefix = sys.real_prefix if hasattr(sys, 'real_prefix') else sys.base_prefix pkgnames = find_package_names() for k, v in list(deps.items()): p = v['path'] if p and not p.startswith(baseprefix): if is_site_package(p): if not p.endswith('.pyd'): if '/win32/' in p.replace('\\', '/'): reqs['win32'] |= set(v['imported_by']) else: name = k.split('.', 1)[0] if name not in skiplist: reqs[name] |= set(v['imported_by']) if '_dummy' in reqs: del reqs['_dummy'] return '\n'.join(dep2req(name, pkgnames[name], reqs[name]) for name in sorted(reqs))
/** * IN relational operator. * This is a binary operator which takes a comma delimited right operand and * creates equals predicates with the left operand and each right operand token. * The equals predicates are combined with an OR predicate. * */ public class InOperator extends AbstractOperator implements RelationalOperator { public InOperator() { super(0); } @Override public String getName() { return "InOperator"; } @Override public Predicate toPredicate(String prop, String val) throws InvalidQueryException { if (val == null) { throw new InvalidQueryException("IN operator is missing a required right operand."); } String[] tokens = val.split(","); List<EqualsPredicate> listPredicates = new ArrayList<EqualsPredicate>(); for (String token : tokens) { listPredicates.add(new EqualsPredicate(prop, token.trim())); } return listPredicates.size() == 1 ? listPredicates.get(0) : buildOrPredicate(listPredicates); } private OrPredicate buildOrPredicate(List<EqualsPredicate> listPredicates) { return new OrPredicate(listPredicates.toArray(new BasePredicate[listPredicates.size()])); } @Override public TYPE getType() { return TYPE.IN; } }
from ASR.asr import ASR from ASR.asr import Gen_batch from punctuations.punctuation import Punctuation from word2number.extractor import NumberExtractor def main_asr(path_wav, model_path_asr='/content/drive/MyDrive/easy_meeting/models/ru_3_norm/wav2vec2-large-xlsr-russian-demo/checkpoint-3540', processor_path_asr='jonatasgrosman/wav2vec2-large-xlsr-53-russian', yml_path_punctuation='/content/drive/MyDrive/easy_meeting/models/maks/latest_silero_models.yml', model_path_punctuation='/content/drive/MyDrive/easy_meeting/models/maks/v1_4lang_q.pt', device='cpu', min_len_sec=100, max_len_sec=150, step_punctuation=30, ): asr = ASR(model_path=model_path_asr, processor_path=processor_path_asr, device=device) data = Gen_batch(path_wav, min_len=min_len_sec, max_len=max_len_sec) text = '' for name, i in enumerate(data.get_batch()): text += asr.inference(i) + ' ' punct = Punctuation(yml_path=yml_path_punctuation, model_path= model_path_punctuation, step=step_punctuation) text_ = punct.apply_te(text) ext = NumberExtractor() text_with_num = ext.replace_groups(text_) return text_with_num # if __name__ == "__main__": # path_wav = '' # text_with_num = main_asr(path_wav) # print(text_with_num)
/* Copy a single mb_data_t and append it to another list. */ static int data_copy (mb_data_t **dst, const mb_data_t *src) { mb_data_t *tmp; int status; if ((dst == NULL) || (src == NULL)) return (EINVAL); tmp = malloc (sizeof (*tmp)); if (tmp == NULL) return (ENOMEM); memcpy (tmp, src, sizeof (*tmp)); tmp->name = NULL; tmp->next = NULL; tmp->name = strdup (src->name); if (tmp->name == NULL) { sfree (tmp); return (ENOMEM); } status = data_append (dst, tmp); if (status != 0) { sfree (tmp->name); sfree (tmp); return (status); } return (0); }
For more than a decade, social networking has taken over internet users’ lives, with social networking apps being the preferred entry point for content and engagement. According to studies, teenagers spend at least nine hours per day on social networks, with the majority of this being done through mobile devices. The same data says that users spend even more time on social media than actual socializing. There is a downside, of course, which is privacy. As the saying goes, if the product is free, then chances are that you are the product. Facebook, Twitter, and other social networks give you untethered access to their platforms, all in exchange for something valuable – insights into your behaviors, preferences, habits, connections, location, and content. Most of the drawbacks of social networking stem from the fact that actual control is centralized on the platform owner, even if the content and activity come from its users. Enter the Blockchain Since its inception around eight years ago, Bitcoin has only recently caught the interest of the internet-at-large, mostly due to its potential as an instrument for investment. While the value of the cryptocurrency itself is volatile and always fluctuating, it is the underlying technology that holds promise across industries. The blockchain – the decentralized and distributed ledger used by cryptocurrencies – can also be used to disrupt other industries and applications. Now, blockchain startups have gone beyond cryptocurrencies. With blockchain systems like Ethereum and NEO offering the ability to run applications and establish smart contracts, there is an opportunity to disrupt all sorts of industries – social networking one of them. The new generation of social networks addresses the disadvantages of a centralized approach to social networking in favor of a decentralized system, thereby bringing about efficiency, privacy, and security gains. One of these is Nexus, a platform that combines social networking with crowdfunding. Another is Obsidian, which is focused on the messaging aspect of social networking. Here is why a blockchain-based approach to social networking is beneficial. You are not the “product” Social networks are a goldmine of user information, and the likes of Facebook, Twitter, Instagram, and more, are exchanging our aggregated information to provide their clients better targeting for their advertising and marketing campaigns. If you do a cursory review of the Terms of Service of most social networks, you will notice one common theme: that once you upload your content on the platform, the social network has the right to access your content for their own purposes, whether these are text, images, videos, and the like. While Facebook says that “you own all of the content and information you post on Facebook,” the reality is that the company, it also says that it uses information gathered from users to target advertising and customize engagement. This brings us to our next point … Better control over content A blockchain-based approach to social networking addresses this by establishing a decentralized approach to connectivity. By getting rid of the central server, there is no single entity that can enforce such monitoring and controls over user-generated content. This is the main point of Obsidian’s founders when they started building the Obsidian Messenger over its Stratis-based blockchain. “The main difference between our messenger client and others is that our system is completely decentralized,” says Peter McClory, CEO of Obsidian. This offers several advantages in terms of user control, chief of which being that content will not be used for analytics and advertising. “Running a decentralized network doesn’t come for free, somebody has to pay to run the hosts,” McClory adds. “That’s why we needed a cryptocurrency, that can pay rewards to node hosts so that they have a financial incentive to run decentralized messaging nodes. Which in turn takes the decentralization a step further, as this removes any financial incentive for the Company to run advertising or sell user data (if they had access to that, which they won’t).” Improved security If aggregated analytics and user targeting are not bad enough, social networks like Facebook are even being accused of eavesdropping on users through smartphone microphones. For most people, this might not be a concern, but for those who are paranoid about their privacy, then the most viable option is to not join social networks at all. However, social networks still have their merits, in terms of business networking, collaboration, and exchange of ideas. Here, we can again highlight the decentralized nature of the blockchain, which ensures privacy and security through a distributed consensus mechanism. “By decentralizing and encrypting all data and uploads, Nexus hopes to eliminate all invasion of privacy that large corporations are currently performing,” says Nexus founder Jade Mulholland. Obsidian’s McClory shares: “The issue many of these apps (WhatsApp, Signal, Wire, Threema, etc.) have is that none of the well-known secure messengers protect communication metadata effectively enough, that is, who is communicating with whom. This lets observers and/or the company that runs the messenger on their servers create a network of people who exchange messages. That’s especially a problem when user accounts are linked to email addresses or phone numbers.” Which again brings us to the next point … Freedom of speech For those in repressive regimes or where censorship is an issue, a blockchain-based approach to social networking offers the benefits of secure authentication whilst still ensuring anonymity. Even with messaging services like iMessage, WhatsApp, and others, having end-to-end encryption, the problem lies with the meta-data that gets exchanged with the messages, which leave digital breadcrumbs that third parties can pick up. Thus, even if eavesdroppers do not know the contents of a message, they can determine where it came from, who it is addressed to, and other such details. Platforms like Obsidian provide a way for users to circumvent the censors and to avoid surveillance. “We have completely removed the requirement for user accounts, so that addresses will never contain any information that can be linked to phone numbers, email or other accounts,” says McClory. “By implementing a decentralized approach, communication metadata is scattered over the globe.” A way to make payments Apart from messaging, peer-to-peer commerce is another area being explored by social networks. Blackberry has attempted this with BBM’s resurgence in some markets in Asia (particularly Indonesia). Facebook is also implementing some form of payment mechanism through Messenger. However, there is usually a disjoint in terms of the messaging and the payment platform. A blockchain-based approach to messaging and social network can easily address this need. Because cryptocurrencies are blockchain-based, then users can easily exchange coins or tokens through the same social network. In addition, smart contracts can make social networks function more like a trusted network, wherein users can make actual deals or exchange of value through cryptographically-signed and executed contracts. There is potential for all kinds of industries integrating social with all sorts of transactions. The potential for crowdfunding Finally, we can point to the popularity of crowdfunding websites like Kickstarter and Indiegogo. Consider also how startups have successfully raised capital through tokensales or ICOs. A social network that runs on the blockchain can let users easily raise money through crowdfunding. The same decentralized network that runs the cryptocurrency can also support similar crowdsales without having to utilize external payment mechanisms. Nexus’ Mulholland adds that “Social, our cryptocurrency, can be used to do many things on the social network, such as buying and selling in the marketplace, purchasing ad space, and donating to crowdfunding campaigns.” Conclusion The rapid growth of social networks has led to burgeoning infrastructure that has required platform owners to primarily earn their keep through ad sales. This has led users to be at a disadvantage because their data has become the “currency” being traded by social networks. A decentralized approach to social networking can ensure better privacy, as well as the potential to do more with smart apps and contracts, as well as e-commerce and crowdfunding transactions. Be the first to know about our price analysis, crypto news and trading tips: Follow us on Telegram or subscribe to our weekly newsletter.
Perspectives on intellectual disability in Taiwan: epidemiology, policy and services for children and adults Purpose of review The present review examines the most recent published references to epidemiology, healthcare needs and utilization and social and health policy relating to people with intellectual disability in Taiwan. Method Electronic searches of Medline, PubMed and PsychInfo literature using the key terms of epidemiology, etiology, welfare policy, health policy, health services, intellectual disability, learning disability and mental retardation as well as a thorough manual search for relevant literature. Recent findings The administrative prevalence of intellectual disability was 0.318–0.396%, and men accounted for a higher percentage of cases than women in Taiwan. Institutionalized care still dominates disability services provided in this society, and the number of institutions and staff working therein has increased steadily in recent years. Many studies also identify the high risk for ill health accompanied by physical/mental diseases in people with intellectual disability, with this group also requiring more healthcare services than the general population in Taiwan. There are still many barriers to accessibility and availability of health and social services confronting people with intellectual disability and their caregivers under the National Health Insurance scheme in Taiwan. Summary As a result of this review process, this paper suggests that future study should focus on an evaluation of the efficacy of current health and social policies related to people with intellectual disability, and that supportive health environments be initiated for this group of people living in institutions or in the community.
<reponame>Asymmetric-Effort/asymmetric-toolkit package cli import ( "strings" ) /* Specification::AddDomain() implements --domain <string> flags. */ const ( domainHelpText = "Specifies a fully qualified domain name." domainArgLong = "domain" ) func (o *Specification) AddDomain(defaultValue string) { // // Initialize the Argument object. // if strings.TrimSpace(defaultValue)==""{ panic("domain cannot be empty string.") } o.Initialize() o.Argument[domainArgLong] = ArgumentDescriptor{ FlagDomain, String, defaultValue, domainHelpText, ParserString(fqdnOrIpRegex), ExpectValue, } }
/* * Public required because interface is in extension */ public class DataIngest implements JtIngest { private final transient JtMonitor monitor = JtMonitor.create(this.getClass()); @Override public Envelop in(final RoutingContext context, final JtUri uri) { /* Read parameter mode */ final ParamMode mode = uri.paramMode(); final Supplier<JtIngest> supplier = Pool.INNER_INGEST.get(mode); /* Inner assert */ assert null != supplier : "Function must not be null here."; final JtIngest ingest = supplier.get(); /* * Monitor information here */ this.monitor.ingestParam(mode, ingest); /* * Verifier on request data */ final Envelop envelop = ingest.in(context, uri); /* * Monitor here */ final JsonObject params = envelop.data(); this.monitor.ingestFinal(params); final Envelop error = this.validate(envelop, uri); return Objects.isNull(error) ? envelop : error; } private Envelop validate(final Envelop envelop, final JtUri uri) { final JsonObject data = envelop.data(); Envelop error = Verifier.validateRequired(this.getClass(), data, uri.paramRequired()); /* Specification of mode */ final ParamMode mode = uri.paramMode(); if ((ParamMode.BODY == mode || ParamMode.DEFINE == mode) && null == error) { /* Body validation */ error = Verifier.validateContained(this.getClass(), data, uri.paramContained()); } return error; } }
def pageList(pageCount=8): for i in range(pageCount//2): if i%2: yield i, pageCount-i-1 else: yield pageCount-i-1, i
#include <stdio.h> int main(){ char name[20]; int grade; FILE *write; //Üzerine yazmak istediğimiz dosyayı pointer olarak alabilmek için FILE tipi değişkeni gösteren pointer tanımlıyoruz if((write = fopen("file_name", "w")) == NULL){ //fopen() içine açmak istediğimiz dosyayı ve hangi amaçla açtığımızı "w/r" yazıyoruz puts("The file couldn't be opened!"); //dosyayı açma işlemi başarısız olursa akışı buraya yöneltiyor } else{ //dosya açılmasında sorun yoksa else bloğu devreye giriyor puts("Enter the grade and the name."); puts("Enter eof to end input."); scanf("%d %s", &grade, name); while(!feof(stdin)){ //kullanıcı feof girene kadar veri alınıp dosyaya yazılacak fprintf(write, "%d\t%s\n", grade, name); //fprintf() ile dosyaya verileri yazıyoruz scanf("%d %s", &grade, name); } fclose(write); //işlem bitince dosyayı kapatıyoruz } return 0; }
<filename>@types/node-gtk/RygelServer-2.6.d.ts /** * RygelServer-2.6 */ /// <reference types="node" /> /// <reference path="RygelCore-2.6.d.ts" /> /// <reference path="GLib-2.0.d.ts" /> /// <reference path="Gee-0.8.d.ts" /> /// <reference path="Gio-2.0.d.ts" /> /// <reference path="GObject-2.0.d.ts" /> /// <reference path="GUPnP-1.2.d.ts" /> /// <reference path="libxml2-2.0.d.ts" /> /// <reference path="Soup-2.4.d.ts" /> /// <reference path="GSSDP-1.2.d.ts" /> /// <reference path="GUPnPAV-1.0.d.ts" /> declare namespace RygelServer { export enum LogicalOperator { AND, OR, } export enum ObjectEventType { ADDED, MODIFIED, DELETED, } export enum SerializerType { GENERIC_DIDL, DIDL_S, M3UEXT, } export enum WritableContainerError { NOT_IMPLEMENTED, } export enum MediaEngineError { NOT_FOUND, } export enum HTTPSeekRequestError { INVALID_RANGE, BAD_REQUEST, OUT_OF_RANGE, } export enum DataSourceError { GENERAL, SEEK_FAILED, PLAYSPEED_FAILED, } export enum HTTPRequestError { UNACCEPTABLE, BAD_REQUEST, NOT_FOUND, INTERNAL_SERVER_ERROR, } export enum PlaySpeedError { INVALID_SPEED_FORMAT, SPEED_NOT_PRESENT, } export class SearchableContainer { /* Properties of RygelServer.SearchableContainer */ searchClasses: Gee.ArrayList /* Methods of RygelServer.SearchableContainer */ search(expression: SearchExpression | null, offset: number, maxCount: number, sortCriteria: string, cancellable?: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback | null): void searchFinish(res: Gio.AsyncResult): [ /* returnType */ MediaObjects | null, /* totalMatches */ number ] simpleSearch(expression: SearchExpression | null, offset: number, maxCount: number, sortCriteria: string, cancellable?: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback | null): void simpleSearchFinish(res: Gio.AsyncResult): [ /* returnType */ MediaObjects | null, /* totalMatches */ number ] findObject(id: string, cancellable?: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback | null): void findObjectFinish(res: Gio.AsyncResult): MediaObject | null getSearchClasses(): Gee.ArrayList setSearchClasses(value: Gee.ArrayList): void /* Virtual methods of RygelServer.SearchableContainer */ vfuncSearch?(expression: SearchExpression | null, offset: number, maxCount: number, sortCriteria: string, cancellable?: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback | null): void vfuncSearchFinish?(res: Gio.AsyncResult): [ /* returnType */ MediaObjects | null, /* totalMatches */ number ] vfuncGetSearchClasses?(): Gee.ArrayList vfuncSetSearchClasses?(value: Gee.ArrayList): void static name: string } export class TrackableContainer { /* Methods of RygelServer.TrackableContainer */ clear(callback?: Gio.AsyncReadyCallback | null): void clearFinish(res: Gio.AsyncResult): void addChild(object: MediaObject, callback?: Gio.AsyncReadyCallback | null): void addChildFinish(res: Gio.AsyncResult): void addChildTracked(object: MediaObject, callback?: Gio.AsyncReadyCallback | null): void addChildTrackedFinish(res: Gio.AsyncResult): void removeChild(object: MediaObject, callback?: Gio.AsyncReadyCallback | null): void removeChildFinish(res: Gio.AsyncResult): void removeChildTracked(object: MediaObject, callback?: Gio.AsyncReadyCallback | null): void removeChildTrackedFinish(res: Gio.AsyncResult): void getServiceResetToken(): string setServiceResetToken(token: string): void getSystemUpdateId(): number /* Virtual methods of RygelServer.TrackableContainer */ vfuncAddChild?(object: MediaObject, callback?: Gio.AsyncReadyCallback | null): void vfuncAddChildFinish?(res: Gio.AsyncResult): void vfuncRemoveChild?(object: MediaObject, callback?: Gio.AsyncReadyCallback | null): void vfuncRemoveChildFinish?(res: Gio.AsyncResult): void vfuncGetServiceResetToken?(): string vfuncSetServiceResetToken?(token: string): void vfuncGetSystemUpdateId?(): number /* Signals of RygelServer.TrackableContainer */ connect(sigName: "child-added", callback: (($obj: TrackableContainer, object: MediaObject) => void)): number connect_after(sigName: "child-added", callback: (($obj: TrackableContainer, object: MediaObject) => void)): number emit(sigName: "child-added", object: MediaObject): void on(sigName: "child-added", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "child-added", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "child-added", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "child-removed", callback: (($obj: TrackableContainer, object: MediaObject) => void)): number connect_after(sigName: "child-removed", callback: (($obj: TrackableContainer, object: MediaObject) => void)): number emit(sigName: "child-removed", object: MediaObject): void on(sigName: "child-removed", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "child-removed", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "child-removed", callback: (...args: any[]) => void): NodeJS.EventEmitter static name: string } export class TrackableItem { /* Methods of RygelServer.TrackableItem */ changed(): void static name: string } export class VisualItem { /* Properties of RygelServer.VisualItem */ width: number height: number colorDepth: number thumbnails: Gee.ArrayList /* Methods of RygelServer.VisualItem */ getWidth(): number setWidth(value: number): void getHeight(): number setHeight(value: number): void getColorDepth(): number setColorDepth(value: number): void getThumbnails(): Gee.ArrayList setThumbnails(value: Gee.ArrayList): void /* Virtual methods of RygelServer.VisualItem */ vfuncGetWidth?(): number vfuncSetWidth?(value: number): void vfuncGetHeight?(): number vfuncSetHeight?(value: number): void vfuncGetColorDepth?(): number vfuncSetColorDepth?(value: number): void vfuncGetThumbnails?(): Gee.ArrayList vfuncSetThumbnails?(value: Gee.ArrayList): void static name: string } export class WritableContainer { /* Properties of RygelServer.WritableContainer */ createClasses: Gee.ArrayList /* Methods of RygelServer.WritableContainer */ canCreate(upnpClass: string): boolean addItem(item: MediaFileItem, cancellable?: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback | null): void addItemFinish(res: Gio.AsyncResult): void addContainer(container: MediaContainer, cancellable?: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback | null): void addContainerFinish(res: Gio.AsyncResult): void addReference(object: MediaObject, cancellable?: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback | null): void addReferenceFinish(res: Gio.AsyncResult): string removeItem(id: string, cancellable?: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback | null): void removeItemFinish(res: Gio.AsyncResult): void removeContainer(id: string, cancellable?: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback | null): void removeContainerFinish(res: Gio.AsyncResult): void getCreateClasses(): Gee.ArrayList setCreateClasses(value: Gee.ArrayList): void /* Virtual methods of RygelServer.WritableContainer */ vfuncAddItem?(item: MediaFileItem, cancellable?: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback | null): void vfuncAddItemFinish?(res: Gio.AsyncResult): void vfuncAddContainer?(container: MediaContainer, cancellable?: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback | null): void vfuncAddContainerFinish?(res: Gio.AsyncResult): void vfuncAddReference?(object: MediaObject, cancellable?: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback | null): void vfuncAddReferenceFinish?(res: Gio.AsyncResult): string vfuncRemoveItem?(id: string, cancellable?: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback | null): void vfuncRemoveItemFinish?(res: Gio.AsyncResult): void vfuncRemoveContainer?(id: string, cancellable?: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback | null): void vfuncRemoveContainerFinish?(res: Gio.AsyncResult): void vfuncGetCreateClasses?(): Gee.ArrayList vfuncSetCreateClasses?(value: Gee.ArrayList): void static name: string } export class DataSource { /* Methods of RygelServer.DataSource */ preroll(seek?: HTTPSeekRequest | null, playspeed?: PlaySpeedRequest | null): Gee.List | null start(): void freeze(): void thaw(): void stop(): void /* Virtual methods of RygelServer.DataSource */ vfuncPreroll?(seek?: HTTPSeekRequest | null, playspeed?: PlaySpeedRequest | null): Gee.List | null vfuncStart?(): void vfuncFreeze?(): void vfuncThaw?(): void vfuncStop?(): void /* Signals of RygelServer.DataSource */ connect(sigName: "data-available", callback: (($obj: DataSource, data: any) => void)): number connect_after(sigName: "data-available", callback: (($obj: DataSource, data: any) => void)): number emit(sigName: "data-available", data: any): void on(sigName: "data-available", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "data-available", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "data-available", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "done", callback: (($obj: DataSource) => void)): number connect_after(sigName: "done", callback: (($obj: DataSource) => void)): number emit(sigName: "done"): void on(sigName: "done", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "done", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "done", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "error", callback: (($obj: DataSource, error: GLib.Error) => void)): number connect_after(sigName: "error", callback: (($obj: DataSource, error: GLib.Error) => void)): number emit(sigName: "error", error: GLib.Error): void on(sigName: "error", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "error", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "error", callback: (...args: any[]) => void): NodeJS.EventEmitter static name: string } export class UpdatableObject { /* Methods of RygelServer.UpdatableObject */ commit(callback?: Gio.AsyncReadyCallback | null): void commitFinish(res: Gio.AsyncResult): void /* Virtual methods of RygelServer.UpdatableObject */ vfuncCommit?(callback?: Gio.AsyncReadyCallback | null): void vfuncCommitFinish?(res: Gio.AsyncResult): void static name: string } export interface AudioItem_ConstructProps extends MediaFileItem_ConstructProps { duration?: number bitrate?: number sampleFreq?: number bitsPerSample?: number channels?: number album?: string } export class AudioItem { /* Properties of RygelServer.AudioItem */ duration: number bitrate: number sampleFreq: number bitsPerSample: number channels: number album: string /* Properties of RygelServer.MediaFileItem */ mimeType: string dlnaProfile: string size: number placeHolder: boolean /* Properties of RygelServer.MediaItem */ description: string /* Properties of RygelServer.MediaObject */ id: string refId: string upnpClass: string date: string creator: string modified: number objectUpdateId: number artist: string genre: string parent: MediaContainer parentRef: MediaContainer title: string readonly ocmFlags: GUPnPAV.OCMFlags /* Fields of RygelServer.AudioItem */ /* Fields of RygelServer.MediaFileItem */ rygelMediaFileItemAddressRegex: GLib.Regex rygelMediaFileItemMimeToExt: Gee.HashMap /* Fields of RygelServer.MediaItem */ /* Fields of RygelServer.MediaObject */ parentPtr: MediaContainer /* Fields of GObject.Object */ gTypeInstance: GObject.TypeInstance /* Methods of RygelServer.AudioItem */ getDuration(): number setDuration(value: number): void getBitrate(): number setBitrate(value: number): void getSampleFreq(): number setSampleFreq(value: number): void getBitsPerSample(): number setBitsPerSample(value: number): void getChannels(): number setChannels(value: number): void getAlbum(): string setAlbum(value: string): void /* Methods of RygelServer.MediaFileItem */ getPrimaryResource(): MediaResource getExtension(): string extFromMimeType(mimeType: string): string addEngineResources(callback?: Gio.AsyncReadyCallback | null): void addEngineResourcesFinish(res: Gio.AsyncResult): void addAdditionalResources(server: HTTPServer): void getMimeType(): string setMimeType(value: string): void getDlnaProfile(): string setDlnaProfile(value: string): void getSize(): number setSize(value: number): void getPlaceHolder(): boolean setPlaceHolder(value: boolean): void /* Methods of RygelServer.MediaItem */ getDescription(): string setDescription(value: string): void /* Methods of RygelServer.MediaObject */ getUris(): Gee.List getPrimaryUri(): string | null addUri(uri: string): void getWritable(cancellable?: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback | null): void getWritableFinish(res: Gio.AsyncResult): Gio.File | null getWritables(cancellable?: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback | null): void getWritablesFinish(res: Gio.AsyncResult): Gee.ArrayList getResourceList(): Gee.List getResourceByName(resourceName: string): MediaResource | null serialize(serializer: Serializer, httpServer: HTTPServer): GUPnPAV.DIDLLiteObject | null serializeResourceList(didlObject: GUPnPAV.DIDLLiteObject, httpServer: HTTPServer): void createStreamSourceForResource(request: HTTPRequest, resource: MediaResource): DataSource | null applyDidlLite(didlObject: GUPnPAV.DIDLLiteObject): void compareByProperty(mediaObject: MediaObject, property: string): number compareStringProps(prop1: string, prop2: string): number compareIntProps(prop1: number, prop2: number): number getId(): string setId(value: string): void getRefId(): string setRefId(value: string): void getUpnpClass(): string setUpnpClass(value: string): void getDate(): string setDate(value: string): void getCreator(): string setCreator(value: string): void getModified(): number setModified(value: number): void getObjectUpdateId(): number setObjectUpdateId(value: number): void getArtist(): string setArtist(value: string): void getGenre(): string setGenre(value: string): void getParent(): MediaContainer setParent(value: MediaContainer): void getParentRef(): MediaContainer setParentRef(value: MediaContainer): void getTitle(): string setTitle(value: string): void getOcmFlags(): GUPnPAV.OCMFlags /* Methods of GObject.Object */ bindProperty(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags): GObject.Binding bindPropertyFull(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags, transformTo: GObject.Closure, transformFrom: GObject.Closure): GObject.Binding forceFloating(): void freezeNotify(): void getData(key: string): object | null getProperty(propertyName: string, value: GObject.Value): void getQdata(quark: GLib.Quark): object | null getv(names: string[], values: GObject.Value[]): void isFloating(): boolean notify(propertyName: string): void notifyByPspec(pspec: GObject.ParamSpec): void ref(): GObject.Object refSink(): GObject.Object runDispose(): void setData(key: string, data?: object | null): void setProperty(propertyName: string, value: GObject.Value): void stealData(key: string): object | null stealQdata(quark: GLib.Quark): object | null thawNotify(): void unref(): void watchClosure(closure: GObject.Closure): void /* Virtual methods of RygelServer.MediaFileItem */ vfuncGetPrimaryResource?(): MediaResource vfuncGetExtension?(): string vfuncAddEngineResources?(callback?: Gio.AsyncReadyCallback | null): void vfuncAddEngineResourcesFinish?(res: Gio.AsyncResult): void vfuncAddAdditionalResources?(server: HTTPServer): void /* Virtual methods of RygelServer.MediaObject */ vfuncAddUri?(uri: string): void vfuncSerialize?(serializer: Serializer, httpServer: HTTPServer): GUPnPAV.DIDLLiteObject | null vfuncCreateStreamSourceForResource?(request: HTTPRequest, resource: MediaResource): DataSource | null vfuncApplyDidlLite?(didlObject: GUPnPAV.DIDLLiteObject): void vfuncCompareByProperty?(mediaObject: MediaObject, property: string): number vfuncGetOcmFlags?(): GUPnPAV.OCMFlags /* Virtual methods of GObject.Object */ vfuncConstructed?(): void vfuncDispatchPropertiesChanged?(nPspecs: number, pspecs: GObject.ParamSpec): void vfuncDispose?(): void vfuncFinalize?(): void vfuncGetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void vfuncNotify?(pspec: GObject.ParamSpec): void vfuncSetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void /* Signals of GObject.Object */ connect(sigName: "notify", callback: (($obj: AudioItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify", callback: (($obj: AudioItem, pspec: GObject.ParamSpec) => void)): number emit(sigName: "notify", pspec: GObject.ParamSpec): void on(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::duration", callback: (($obj: AudioItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::duration", callback: (($obj: AudioItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::duration", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::duration", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::duration", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::bitrate", callback: (($obj: AudioItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::bitrate", callback: (($obj: AudioItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::bitrate", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::bitrate", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::bitrate", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::sample-freq", callback: (($obj: AudioItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::sample-freq", callback: (($obj: AudioItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::sample-freq", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::sample-freq", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::sample-freq", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::bits-per-sample", callback: (($obj: AudioItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::bits-per-sample", callback: (($obj: AudioItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::bits-per-sample", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::bits-per-sample", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::bits-per-sample", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::channels", callback: (($obj: AudioItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::channels", callback: (($obj: AudioItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::channels", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::channels", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::channels", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::album", callback: (($obj: AudioItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::album", callback: (($obj: AudioItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::album", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::album", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::album", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::mime-type", callback: (($obj: AudioItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::mime-type", callback: (($obj: AudioItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::mime-type", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::mime-type", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::mime-type", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::dlna-profile", callback: (($obj: AudioItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::dlna-profile", callback: (($obj: AudioItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::dlna-profile", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::dlna-profile", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::dlna-profile", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::size", callback: (($obj: AudioItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::size", callback: (($obj: AudioItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::size", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::size", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::size", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::place-holder", callback: (($obj: AudioItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::place-holder", callback: (($obj: AudioItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::place-holder", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::place-holder", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::place-holder", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::description", callback: (($obj: AudioItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::description", callback: (($obj: AudioItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::description", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::description", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::description", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::id", callback: (($obj: AudioItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::id", callback: (($obj: AudioItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::id", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::id", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::id", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::ref-id", callback: (($obj: AudioItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::ref-id", callback: (($obj: AudioItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::ref-id", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::ref-id", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::ref-id", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::upnp-class", callback: (($obj: AudioItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::upnp-class", callback: (($obj: AudioItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::upnp-class", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::upnp-class", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::upnp-class", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::date", callback: (($obj: AudioItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::date", callback: (($obj: AudioItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::date", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::date", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::date", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::creator", callback: (($obj: AudioItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::creator", callback: (($obj: AudioItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::creator", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::creator", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::creator", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::modified", callback: (($obj: AudioItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::modified", callback: (($obj: AudioItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::modified", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::modified", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::modified", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::object-update-id", callback: (($obj: AudioItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::object-update-id", callback: (($obj: AudioItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::object-update-id", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::object-update-id", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::object-update-id", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::artist", callback: (($obj: AudioItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::artist", callback: (($obj: AudioItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::artist", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::artist", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::artist", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::genre", callback: (($obj: AudioItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::genre", callback: (($obj: AudioItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::genre", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::genre", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::genre", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::parent", callback: (($obj: AudioItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::parent", callback: (($obj: AudioItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::parent", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::parent", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::parent", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::parent-ref", callback: (($obj: AudioItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::parent-ref", callback: (($obj: AudioItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::parent-ref", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::parent-ref", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::parent-ref", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::title", callback: (($obj: AudioItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::title", callback: (($obj: AudioItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::title", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::title", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::title", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::ocm-flags", callback: (($obj: AudioItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::ocm-flags", callback: (($obj: AudioItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::ocm-flags", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::ocm-flags", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::ocm-flags", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: string, callback: any): number connect_after(sigName: string, callback: any): number emit(sigName: string, ...args: any[]): void disconnect(id: number): void on(sigName: string, callback: any): NodeJS.EventEmitter once(sigName: string, callback: any): NodeJS.EventEmitter off(sigName: string, callback: any): NodeJS.EventEmitter static name: string constructor (config?: AudioItem_ConstructProps) _init (config?: AudioItem_ConstructProps): void static new(id: string, parent: MediaContainer, title: string, upnpClass: string): AudioItem static $gtype: GObject.Type } export interface ImageItem_ConstructProps extends MediaFileItem_ConstructProps { } export class ImageItem { /* Properties of RygelServer.MediaFileItem */ mimeType: string dlnaProfile: string size: number placeHolder: boolean /* Properties of RygelServer.MediaItem */ description: string /* Properties of RygelServer.MediaObject */ id: string refId: string upnpClass: string date: string creator: string modified: number objectUpdateId: number artist: string genre: string parent: MediaContainer parentRef: MediaContainer title: string readonly ocmFlags: GUPnPAV.OCMFlags /* Properties of RygelServer.VisualItem */ width: number height: number colorDepth: number thumbnails: Gee.ArrayList /* Fields of RygelServer.ImageItem */ /* Fields of RygelServer.MediaFileItem */ rygelMediaFileItemAddressRegex: GLib.Regex rygelMediaFileItemMimeToExt: Gee.HashMap /* Fields of RygelServer.MediaItem */ /* Fields of RygelServer.MediaObject */ parentPtr: MediaContainer /* Fields of GObject.Object */ gTypeInstance: GObject.TypeInstance /* Methods of RygelServer.MediaFileItem */ getPrimaryResource(): MediaResource getExtension(): string extFromMimeType(mimeType: string): string addEngineResources(callback?: Gio.AsyncReadyCallback | null): void addEngineResourcesFinish(res: Gio.AsyncResult): void addAdditionalResources(server: HTTPServer): void getMimeType(): string setMimeType(value: string): void getDlnaProfile(): string setDlnaProfile(value: string): void getSize(): number setSize(value: number): void getPlaceHolder(): boolean setPlaceHolder(value: boolean): void /* Methods of RygelServer.MediaItem */ getDescription(): string setDescription(value: string): void /* Methods of RygelServer.MediaObject */ getUris(): Gee.List getPrimaryUri(): string | null addUri(uri: string): void getWritable(cancellable?: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback | null): void getWritableFinish(res: Gio.AsyncResult): Gio.File | null getWritables(cancellable?: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback | null): void getWritablesFinish(res: Gio.AsyncResult): Gee.ArrayList getResourceList(): Gee.List getResourceByName(resourceName: string): MediaResource | null serialize(serializer: Serializer, httpServer: HTTPServer): GUPnPAV.DIDLLiteObject | null serializeResourceList(didlObject: GUPnPAV.DIDLLiteObject, httpServer: HTTPServer): void createStreamSourceForResource(request: HTTPRequest, resource: MediaResource): DataSource | null applyDidlLite(didlObject: GUPnPAV.DIDLLiteObject): void compareByProperty(mediaObject: MediaObject, property: string): number compareStringProps(prop1: string, prop2: string): number compareIntProps(prop1: number, prop2: number): number getId(): string setId(value: string): void getRefId(): string setRefId(value: string): void getUpnpClass(): string setUpnpClass(value: string): void getDate(): string setDate(value: string): void getCreator(): string setCreator(value: string): void getModified(): number setModified(value: number): void getObjectUpdateId(): number setObjectUpdateId(value: number): void getArtist(): string setArtist(value: string): void getGenre(): string setGenre(value: string): void getParent(): MediaContainer setParent(value: MediaContainer): void getParentRef(): MediaContainer setParentRef(value: MediaContainer): void getTitle(): string setTitle(value: string): void getOcmFlags(): GUPnPAV.OCMFlags /* Methods of GObject.Object */ bindProperty(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags): GObject.Binding bindPropertyFull(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags, transformTo: GObject.Closure, transformFrom: GObject.Closure): GObject.Binding forceFloating(): void freezeNotify(): void getData(key: string): object | null getProperty(propertyName: string, value: GObject.Value): void getQdata(quark: GLib.Quark): object | null getv(names: string[], values: GObject.Value[]): void isFloating(): boolean notify(propertyName: string): void notifyByPspec(pspec: GObject.ParamSpec): void ref(): GObject.Object refSink(): GObject.Object runDispose(): void setData(key: string, data?: object | null): void setProperty(propertyName: string, value: GObject.Value): void stealData(key: string): object | null stealQdata(quark: GLib.Quark): object | null thawNotify(): void unref(): void watchClosure(closure: GObject.Closure): void /* Methods of RygelServer.VisualItem */ getWidth(): number setWidth(value: number): void getHeight(): number setHeight(value: number): void getColorDepth(): number setColorDepth(value: number): void getThumbnails(): Gee.ArrayList setThumbnails(value: Gee.ArrayList): void /* Virtual methods of RygelServer.MediaFileItem */ vfuncGetPrimaryResource?(): MediaResource vfuncGetExtension?(): string vfuncAddEngineResources?(callback?: Gio.AsyncReadyCallback | null): void vfuncAddEngineResourcesFinish?(res: Gio.AsyncResult): void vfuncAddAdditionalResources?(server: HTTPServer): void /* Virtual methods of RygelServer.MediaObject */ vfuncAddUri?(uri: string): void vfuncSerialize?(serializer: Serializer, httpServer: HTTPServer): GUPnPAV.DIDLLiteObject | null vfuncCreateStreamSourceForResource?(request: HTTPRequest, resource: MediaResource): DataSource | null vfuncApplyDidlLite?(didlObject: GUPnPAV.DIDLLiteObject): void vfuncCompareByProperty?(mediaObject: MediaObject, property: string): number vfuncGetOcmFlags?(): GUPnPAV.OCMFlags /* Virtual methods of GObject.Object */ vfuncConstructed?(): void vfuncDispatchPropertiesChanged?(nPspecs: number, pspecs: GObject.ParamSpec): void vfuncDispose?(): void vfuncFinalize?(): void vfuncGetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void vfuncNotify?(pspec: GObject.ParamSpec): void vfuncSetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void /* Signals of GObject.Object */ connect(sigName: "notify", callback: (($obj: ImageItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify", callback: (($obj: ImageItem, pspec: GObject.ParamSpec) => void)): number emit(sigName: "notify", pspec: GObject.ParamSpec): void on(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::mime-type", callback: (($obj: ImageItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::mime-type", callback: (($obj: ImageItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::mime-type", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::mime-type", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::mime-type", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::dlna-profile", callback: (($obj: ImageItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::dlna-profile", callback: (($obj: ImageItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::dlna-profile", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::dlna-profile", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::dlna-profile", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::size", callback: (($obj: ImageItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::size", callback: (($obj: ImageItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::size", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::size", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::size", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::place-holder", callback: (($obj: ImageItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::place-holder", callback: (($obj: ImageItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::place-holder", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::place-holder", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::place-holder", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::description", callback: (($obj: ImageItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::description", callback: (($obj: ImageItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::description", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::description", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::description", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::id", callback: (($obj: ImageItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::id", callback: (($obj: ImageItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::id", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::id", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::id", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::ref-id", callback: (($obj: ImageItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::ref-id", callback: (($obj: ImageItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::ref-id", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::ref-id", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::ref-id", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::upnp-class", callback: (($obj: ImageItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::upnp-class", callback: (($obj: ImageItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::upnp-class", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::upnp-class", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::upnp-class", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::date", callback: (($obj: ImageItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::date", callback: (($obj: ImageItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::date", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::date", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::date", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::creator", callback: (($obj: ImageItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::creator", callback: (($obj: ImageItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::creator", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::creator", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::creator", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::modified", callback: (($obj: ImageItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::modified", callback: (($obj: ImageItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::modified", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::modified", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::modified", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::object-update-id", callback: (($obj: ImageItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::object-update-id", callback: (($obj: ImageItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::object-update-id", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::object-update-id", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::object-update-id", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::artist", callback: (($obj: ImageItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::artist", callback: (($obj: ImageItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::artist", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::artist", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::artist", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::genre", callback: (($obj: ImageItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::genre", callback: (($obj: ImageItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::genre", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::genre", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::genre", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::parent", callback: (($obj: ImageItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::parent", callback: (($obj: ImageItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::parent", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::parent", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::parent", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::parent-ref", callback: (($obj: ImageItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::parent-ref", callback: (($obj: ImageItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::parent-ref", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::parent-ref", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::parent-ref", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::title", callback: (($obj: ImageItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::title", callback: (($obj: ImageItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::title", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::title", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::title", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::ocm-flags", callback: (($obj: ImageItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::ocm-flags", callback: (($obj: ImageItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::ocm-flags", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::ocm-flags", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::ocm-flags", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::width", callback: (($obj: ImageItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::width", callback: (($obj: ImageItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::width", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::width", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::width", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::height", callback: (($obj: ImageItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::height", callback: (($obj: ImageItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::height", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::height", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::height", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::color-depth", callback: (($obj: ImageItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::color-depth", callback: (($obj: ImageItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::color-depth", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::color-depth", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::color-depth", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::thumbnails", callback: (($obj: ImageItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::thumbnails", callback: (($obj: ImageItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::thumbnails", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::thumbnails", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::thumbnails", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: string, callback: any): number connect_after(sigName: string, callback: any): number emit(sigName: string, ...args: any[]): void disconnect(id: number): void on(sigName: string, callback: any): NodeJS.EventEmitter once(sigName: string, callback: any): NodeJS.EventEmitter off(sigName: string, callback: any): NodeJS.EventEmitter static name: string constructor (config?: ImageItem_ConstructProps) _init (config?: ImageItem_ConstructProps): void static new(id: string, parent: MediaContainer, title: string, upnpClass: string): ImageItem static $gtype: GObject.Type } export class LogicalExpression { /* Fields of RygelServer.LogicalExpression */ /* Fields of RygelServer.SearchExpression */ refCount: number op: object | null operand1: object | null operand2: object | null /* Methods of RygelServer.SearchExpression */ satisfiedBy(mediaObject: MediaObject): boolean /* Virtual methods of RygelServer.SearchExpression */ vfuncSatisfiedBy?(mediaObject: MediaObject): boolean vfuncToString?(): string static name: string static new(): LogicalExpression constructor() static new(): LogicalExpression } export interface MediaArtStore_ConstructProps extends GObject.Object_ConstructProps { } export class MediaArtStore { /* Fields of RygelServer.MediaArtStore */ /* Fields of GObject.Object */ gTypeInstance: GObject.TypeInstance /* Methods of RygelServer.MediaArtStore */ lookupMediaArt(item: MusicItem): Thumbnail | null add(item: MusicItem, file: Gio.File, data: any, mime: string): void searchMediaArtForFile(item: MusicItem, file: Gio.File): void /* Methods of GObject.Object */ bindProperty(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags): GObject.Binding bindPropertyFull(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags, transformTo: GObject.Closure, transformFrom: GObject.Closure): GObject.Binding forceFloating(): void freezeNotify(): void getData(key: string): object | null getProperty(propertyName: string, value: GObject.Value): void getQdata(quark: GLib.Quark): object | null getv(names: string[], values: GObject.Value[]): void isFloating(): boolean notify(propertyName: string): void notifyByPspec(pspec: GObject.ParamSpec): void ref(): GObject.Object refSink(): GObject.Object runDispose(): void setData(key: string, data?: object | null): void setProperty(propertyName: string, value: GObject.Value): void stealData(key: string): object | null stealQdata(quark: GLib.Quark): object | null thawNotify(): void unref(): void watchClosure(closure: GObject.Closure): void /* Virtual methods of GObject.Object */ vfuncConstructed?(): void vfuncDispatchPropertiesChanged?(nPspecs: number, pspecs: GObject.ParamSpec): void vfuncDispose?(): void vfuncFinalize?(): void vfuncGetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void vfuncNotify?(pspec: GObject.ParamSpec): void vfuncSetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void /* Signals of GObject.Object */ connect(sigName: "notify", callback: (($obj: MediaArtStore, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify", callback: (($obj: MediaArtStore, pspec: GObject.ParamSpec) => void)): number emit(sigName: "notify", pspec: GObject.ParamSpec): void on(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: string, callback: any): number connect_after(sigName: string, callback: any): number emit(sigName: string, ...args: any[]): void disconnect(id: number): void on(sigName: string, callback: any): NodeJS.EventEmitter once(sigName: string, callback: any): NodeJS.EventEmitter off(sigName: string, callback: any): NodeJS.EventEmitter static name: string constructor (config?: MediaArtStore_ConstructProps) _init (config?: MediaArtStore_ConstructProps): void static getDefault(): MediaArtStore | null static $gtype: GObject.Type } export interface MediaObjects_ConstructProps extends Gee.ArrayList_ConstructProps { } export class MediaObjects { /* Properties of Gee.ArrayList */ /* Properties of Gee.AbstractBidirList */ readonly readOnlyView: Gee.BidirList /* Properties of Gee.AbstractList */ /* Properties of Gee.AbstractCollection */ readonly size: number readonly readOnly: boolean /* Fields of RygelServer.MediaObjects */ /* Fields of Gee.ArrayList */ items: object[] itemsLength1: number /* Fields of Gee.AbstractBidirList */ /* Fields of Gee.AbstractList */ /* Fields of Gee.AbstractCollection */ /* Fields of GObject.Object */ gTypeInstance: GObject.TypeInstance /* Methods of RygelServer.MediaObjects */ sortByCriteria(sortCriteria: string): void /* Methods of Gee.ArrayList */ addAll(collection: Gee.Collection): boolean getEqualFunc(): [ /* returnType */ Gee.EqualDataFunc, /* resultTarget */ object | null ] /* Methods of Gee.AbstractBidirList */ bidirListIterator(): Gee.BidirListIterator reserved0(): void reserved1(): void reserved2(): void reserved3(): void reserved4(): void reserved5(): void reserved6(): void reserved7(): void reserved8(): void reserved9(): void getReadOnlyView(): Gee.BidirList /* Methods of Gee.AbstractList */ listIterator(): Gee.ListIterator get(index: number): object | null set(index: number, item?: object | null): void indexOf(item?: object | null): number insert(index: number, item?: object | null): void removeAt(index: number): object | null slice(start: number, stop: number): Gee.List | null /* Methods of Gee.AbstractCollection */ contains(item?: object | null): boolean add(item?: object | null): boolean remove(item?: object | null): boolean clear(): void iterator(): Gee.Iterator foreach(f: Gee.ForallFunc): boolean getSize(): number getReadOnly(): boolean /* Methods of GObject.Object */ bindProperty(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags): GObject.Binding bindPropertyFull(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags, transformTo: GObject.Closure, transformFrom: GObject.Closure): GObject.Binding forceFloating(): void freezeNotify(): void getData(key: string): object | null getProperty(propertyName: string, value: GObject.Value): void getQdata(quark: GLib.Quark): object | null getv(names: string[], values: GObject.Value[]): void isFloating(): boolean notify(propertyName: string): void notifyByPspec(pspec: GObject.ParamSpec): void ref(): GObject.Object refSink(): GObject.Object runDispose(): void setData(key: string, data?: object | null): void setProperty(propertyName: string, value: GObject.Value): void stealData(key: string): object | null stealQdata(quark: GLib.Quark): object | null thawNotify(): void unref(): void watchClosure(closure: GObject.Closure): void /* Virtual methods of Gee.AbstractBidirList */ vfuncBidirListIterator?(): Gee.BidirListIterator vfuncReserved0?(): void vfuncReserved1?(): void vfuncReserved2?(): void vfuncReserved3?(): void vfuncReserved4?(): void vfuncReserved5?(): void vfuncReserved6?(): void vfuncReserved7?(): void vfuncReserved8?(): void vfuncReserved9?(): void vfuncGetReadOnlyView?(): Gee.BidirList /* Virtual methods of Gee.AbstractList */ vfuncListIterator?(): Gee.ListIterator vfuncGet?(index: number): object | null vfuncSet?(index: number, item?: object | null): void vfuncIndexOf?(item?: object | null): number vfuncInsert?(index: number, item?: object | null): void vfuncRemoveAt?(index: number): object | null vfuncSlice?(start: number, stop: number): Gee.List | null /* Virtual methods of Gee.AbstractCollection */ vfuncContains?(item?: object | null): boolean vfuncAdd?(item?: object | null): boolean vfuncRemove?(item?: object | null): boolean vfuncClear?(): void vfuncIterator?(): Gee.Iterator vfuncForeach?(f: Gee.ForallFunc): boolean vfuncGetSize?(): number vfuncGetReadOnly?(): boolean /* Virtual methods of GObject.Object */ vfuncConstructed?(): void vfuncDispatchPropertiesChanged?(nPspecs: number, pspecs: GObject.ParamSpec): void vfuncDispose?(): void vfuncFinalize?(): void vfuncGetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void vfuncNotify?(pspec: GObject.ParamSpec): void vfuncSetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void /* Signals of GObject.Object */ connect(sigName: "notify", callback: (($obj: MediaObjects, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify", callback: (($obj: MediaObjects, pspec: GObject.ParamSpec) => void)): number emit(sigName: "notify", pspec: GObject.ParamSpec): void on(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::read-only-view", callback: (($obj: MediaObjects, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::read-only-view", callback: (($obj: MediaObjects, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::read-only-view", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::read-only-view", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::read-only-view", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::size", callback: (($obj: MediaObjects, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::size", callback: (($obj: MediaObjects, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::size", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::size", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::size", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::read-only", callback: (($obj: MediaObjects, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::read-only", callback: (($obj: MediaObjects, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::read-only", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::read-only", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::read-only", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: string, callback: any): number connect_after(sigName: string, callback: any): number emit(sigName: string, ...args: any[]): void disconnect(id: number): void on(sigName: string, callback: any): NodeJS.EventEmitter once(sigName: string, callback: any): NodeJS.EventEmitter off(sigName: string, callback: any): NodeJS.EventEmitter static name: string constructor (config?: MediaObjects_ConstructProps) _init (config?: MediaObjects_ConstructProps): void static new(): MediaObjects static $gtype: GObject.Type } export interface MusicItem_ConstructProps extends AudioItem_ConstructProps { trackNumber?: number albumArt?: Thumbnail } export class MusicItem { /* Properties of RygelServer.MusicItem */ trackNumber: number albumArt: Thumbnail /* Properties of RygelServer.AudioItem */ duration: number bitrate: number sampleFreq: number bitsPerSample: number channels: number album: string /* Properties of RygelServer.MediaFileItem */ mimeType: string dlnaProfile: string size: number placeHolder: boolean /* Properties of RygelServer.MediaItem */ description: string /* Properties of RygelServer.MediaObject */ id: string refId: string upnpClass: string date: string creator: string modified: number objectUpdateId: number artist: string genre: string parent: MediaContainer parentRef: MediaContainer title: string readonly ocmFlags: GUPnPAV.OCMFlags /* Fields of RygelServer.MusicItem */ /* Fields of RygelServer.AudioItem */ /* Fields of RygelServer.MediaFileItem */ rygelMediaFileItemAddressRegex: GLib.Regex rygelMediaFileItemMimeToExt: Gee.HashMap /* Fields of RygelServer.MediaItem */ /* Fields of RygelServer.MediaObject */ parentPtr: MediaContainer /* Fields of GObject.Object */ gTypeInstance: GObject.TypeInstance /* Methods of RygelServer.MusicItem */ lookupAlbumArt(): void getTrackNumber(): number setTrackNumber(value: number): void getAlbumArt(): Thumbnail setAlbumArt(value: Thumbnail): void /* Methods of RygelServer.AudioItem */ getDuration(): number setDuration(value: number): void getBitrate(): number setBitrate(value: number): void getSampleFreq(): number setSampleFreq(value: number): void getBitsPerSample(): number setBitsPerSample(value: number): void getChannels(): number setChannels(value: number): void getAlbum(): string setAlbum(value: string): void /* Methods of RygelServer.MediaFileItem */ getPrimaryResource(): MediaResource getExtension(): string extFromMimeType(mimeType: string): string addEngineResources(callback?: Gio.AsyncReadyCallback | null): void addEngineResourcesFinish(res: Gio.AsyncResult): void addAdditionalResources(server: HTTPServer): void getMimeType(): string setMimeType(value: string): void getDlnaProfile(): string setDlnaProfile(value: string): void getSize(): number setSize(value: number): void getPlaceHolder(): boolean setPlaceHolder(value: boolean): void /* Methods of RygelServer.MediaItem */ getDescription(): string setDescription(value: string): void /* Methods of RygelServer.MediaObject */ getUris(): Gee.List getPrimaryUri(): string | null addUri(uri: string): void getWritable(cancellable?: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback | null): void getWritableFinish(res: Gio.AsyncResult): Gio.File | null getWritables(cancellable?: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback | null): void getWritablesFinish(res: Gio.AsyncResult): Gee.ArrayList getResourceList(): Gee.List getResourceByName(resourceName: string): MediaResource | null serialize(serializer: Serializer, httpServer: HTTPServer): GUPnPAV.DIDLLiteObject | null serializeResourceList(didlObject: GUPnPAV.DIDLLiteObject, httpServer: HTTPServer): void createStreamSourceForResource(request: HTTPRequest, resource: MediaResource): DataSource | null applyDidlLite(didlObject: GUPnPAV.DIDLLiteObject): void compareByProperty(mediaObject: MediaObject, property: string): number compareStringProps(prop1: string, prop2: string): number compareIntProps(prop1: number, prop2: number): number getId(): string setId(value: string): void getRefId(): string setRefId(value: string): void getUpnpClass(): string setUpnpClass(value: string): void getDate(): string setDate(value: string): void getCreator(): string setCreator(value: string): void getModified(): number setModified(value: number): void getObjectUpdateId(): number setObjectUpdateId(value: number): void getArtist(): string setArtist(value: string): void getGenre(): string setGenre(value: string): void getParent(): MediaContainer setParent(value: MediaContainer): void getParentRef(): MediaContainer setParentRef(value: MediaContainer): void getTitle(): string setTitle(value: string): void getOcmFlags(): GUPnPAV.OCMFlags /* Methods of GObject.Object */ bindProperty(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags): GObject.Binding bindPropertyFull(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags, transformTo: GObject.Closure, transformFrom: GObject.Closure): GObject.Binding forceFloating(): void freezeNotify(): void getData(key: string): object | null getProperty(propertyName: string, value: GObject.Value): void getQdata(quark: GLib.Quark): object | null getv(names: string[], values: GObject.Value[]): void isFloating(): boolean notify(propertyName: string): void notifyByPspec(pspec: GObject.ParamSpec): void ref(): GObject.Object refSink(): GObject.Object runDispose(): void setData(key: string, data?: object | null): void setProperty(propertyName: string, value: GObject.Value): void stealData(key: string): object | null stealQdata(quark: GLib.Quark): object | null thawNotify(): void unref(): void watchClosure(closure: GObject.Closure): void /* Virtual methods of RygelServer.MediaFileItem */ vfuncGetPrimaryResource?(): MediaResource vfuncGetExtension?(): string vfuncAddEngineResources?(callback?: Gio.AsyncReadyCallback | null): void vfuncAddEngineResourcesFinish?(res: Gio.AsyncResult): void vfuncAddAdditionalResources?(server: HTTPServer): void /* Virtual methods of RygelServer.MediaObject */ vfuncAddUri?(uri: string): void vfuncSerialize?(serializer: Serializer, httpServer: HTTPServer): GUPnPAV.DIDLLiteObject | null vfuncCreateStreamSourceForResource?(request: HTTPRequest, resource: MediaResource): DataSource | null vfuncApplyDidlLite?(didlObject: GUPnPAV.DIDLLiteObject): void vfuncCompareByProperty?(mediaObject: MediaObject, property: string): number vfuncGetOcmFlags?(): GUPnPAV.OCMFlags /* Virtual methods of GObject.Object */ vfuncConstructed?(): void vfuncDispatchPropertiesChanged?(nPspecs: number, pspecs: GObject.ParamSpec): void vfuncDispose?(): void vfuncFinalize?(): void vfuncGetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void vfuncNotify?(pspec: GObject.ParamSpec): void vfuncSetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void /* Signals of GObject.Object */ connect(sigName: "notify", callback: (($obj: MusicItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify", callback: (($obj: MusicItem, pspec: GObject.ParamSpec) => void)): number emit(sigName: "notify", pspec: GObject.ParamSpec): void on(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::track-number", callback: (($obj: MusicItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::track-number", callback: (($obj: MusicItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::track-number", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::track-number", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::track-number", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::album-art", callback: (($obj: MusicItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::album-art", callback: (($obj: MusicItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::album-art", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::album-art", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::album-art", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::duration", callback: (($obj: MusicItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::duration", callback: (($obj: MusicItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::duration", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::duration", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::duration", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::bitrate", callback: (($obj: MusicItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::bitrate", callback: (($obj: MusicItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::bitrate", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::bitrate", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::bitrate", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::sample-freq", callback: (($obj: MusicItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::sample-freq", callback: (($obj: MusicItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::sample-freq", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::sample-freq", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::sample-freq", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::bits-per-sample", callback: (($obj: MusicItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::bits-per-sample", callback: (($obj: MusicItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::bits-per-sample", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::bits-per-sample", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::bits-per-sample", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::channels", callback: (($obj: MusicItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::channels", callback: (($obj: MusicItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::channels", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::channels", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::channels", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::album", callback: (($obj: MusicItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::album", callback: (($obj: MusicItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::album", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::album", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::album", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::mime-type", callback: (($obj: MusicItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::mime-type", callback: (($obj: MusicItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::mime-type", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::mime-type", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::mime-type", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::dlna-profile", callback: (($obj: MusicItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::dlna-profile", callback: (($obj: MusicItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::dlna-profile", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::dlna-profile", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::dlna-profile", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::size", callback: (($obj: MusicItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::size", callback: (($obj: MusicItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::size", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::size", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::size", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::place-holder", callback: (($obj: MusicItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::place-holder", callback: (($obj: MusicItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::place-holder", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::place-holder", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::place-holder", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::description", callback: (($obj: MusicItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::description", callback: (($obj: MusicItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::description", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::description", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::description", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::id", callback: (($obj: MusicItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::id", callback: (($obj: MusicItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::id", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::id", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::id", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::ref-id", callback: (($obj: MusicItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::ref-id", callback: (($obj: MusicItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::ref-id", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::ref-id", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::ref-id", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::upnp-class", callback: (($obj: MusicItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::upnp-class", callback: (($obj: MusicItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::upnp-class", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::upnp-class", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::upnp-class", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::date", callback: (($obj: MusicItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::date", callback: (($obj: MusicItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::date", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::date", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::date", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::creator", callback: (($obj: MusicItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::creator", callback: (($obj: MusicItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::creator", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::creator", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::creator", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::modified", callback: (($obj: MusicItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::modified", callback: (($obj: MusicItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::modified", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::modified", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::modified", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::object-update-id", callback: (($obj: MusicItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::object-update-id", callback: (($obj: MusicItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::object-update-id", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::object-update-id", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::object-update-id", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::artist", callback: (($obj: MusicItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::artist", callback: (($obj: MusicItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::artist", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::artist", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::artist", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::genre", callback: (($obj: MusicItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::genre", callback: (($obj: MusicItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::genre", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::genre", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::genre", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::parent", callback: (($obj: MusicItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::parent", callback: (($obj: MusicItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::parent", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::parent", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::parent", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::parent-ref", callback: (($obj: MusicItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::parent-ref", callback: (($obj: MusicItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::parent-ref", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::parent-ref", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::parent-ref", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::title", callback: (($obj: MusicItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::title", callback: (($obj: MusicItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::title", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::title", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::title", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::ocm-flags", callback: (($obj: MusicItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::ocm-flags", callback: (($obj: MusicItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::ocm-flags", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::ocm-flags", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::ocm-flags", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: string, callback: any): number connect_after(sigName: string, callback: any): number emit(sigName: string, ...args: any[]): void disconnect(id: number): void on(sigName: string, callback: any): NodeJS.EventEmitter once(sigName: string, callback: any): NodeJS.EventEmitter off(sigName: string, callback: any): NodeJS.EventEmitter static name: string constructor (config?: MusicItem_ConstructProps) _init (config?: MusicItem_ConstructProps): void static new(id: string, parent: MediaContainer, title: string, upnpClass: string): MusicItem static $gtype: GObject.Type } export interface PhotoItem_ConstructProps extends ImageItem_ConstructProps { } export class PhotoItem { /* Properties of RygelServer.MediaFileItem */ mimeType: string dlnaProfile: string size: number placeHolder: boolean /* Properties of RygelServer.MediaItem */ description: string /* Properties of RygelServer.MediaObject */ id: string refId: string upnpClass: string date: string creator: string modified: number objectUpdateId: number artist: string genre: string parent: MediaContainer parentRef: MediaContainer title: string readonly ocmFlags: GUPnPAV.OCMFlags /* Fields of RygelServer.PhotoItem */ /* Fields of RygelServer.ImageItem */ /* Fields of RygelServer.MediaFileItem */ rygelMediaFileItemAddressRegex: GLib.Regex rygelMediaFileItemMimeToExt: Gee.HashMap /* Fields of RygelServer.MediaItem */ /* Fields of RygelServer.MediaObject */ parentPtr: MediaContainer /* Fields of GObject.Object */ gTypeInstance: GObject.TypeInstance /* Methods of RygelServer.MediaFileItem */ getPrimaryResource(): MediaResource getExtension(): string extFromMimeType(mimeType: string): string addEngineResources(callback?: Gio.AsyncReadyCallback | null): void addEngineResourcesFinish(res: Gio.AsyncResult): void addAdditionalResources(server: HTTPServer): void getMimeType(): string setMimeType(value: string): void getDlnaProfile(): string setDlnaProfile(value: string): void getSize(): number setSize(value: number): void getPlaceHolder(): boolean setPlaceHolder(value: boolean): void /* Methods of RygelServer.MediaItem */ getDescription(): string setDescription(value: string): void /* Methods of RygelServer.MediaObject */ getUris(): Gee.List getPrimaryUri(): string | null addUri(uri: string): void getWritable(cancellable?: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback | null): void getWritableFinish(res: Gio.AsyncResult): Gio.File | null getWritables(cancellable?: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback | null): void getWritablesFinish(res: Gio.AsyncResult): Gee.ArrayList getResourceList(): Gee.List getResourceByName(resourceName: string): MediaResource | null serialize(serializer: Serializer, httpServer: HTTPServer): GUPnPAV.DIDLLiteObject | null serializeResourceList(didlObject: GUPnPAV.DIDLLiteObject, httpServer: HTTPServer): void createStreamSourceForResource(request: HTTPRequest, resource: MediaResource): DataSource | null applyDidlLite(didlObject: GUPnPAV.DIDLLiteObject): void compareByProperty(mediaObject: MediaObject, property: string): number compareStringProps(prop1: string, prop2: string): number compareIntProps(prop1: number, prop2: number): number getId(): string setId(value: string): void getRefId(): string setRefId(value: string): void getUpnpClass(): string setUpnpClass(value: string): void getDate(): string setDate(value: string): void getCreator(): string setCreator(value: string): void getModified(): number setModified(value: number): void getObjectUpdateId(): number setObjectUpdateId(value: number): void getArtist(): string setArtist(value: string): void getGenre(): string setGenre(value: string): void getParent(): MediaContainer setParent(value: MediaContainer): void getParentRef(): MediaContainer setParentRef(value: MediaContainer): void getTitle(): string setTitle(value: string): void getOcmFlags(): GUPnPAV.OCMFlags /* Methods of GObject.Object */ bindProperty(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags): GObject.Binding bindPropertyFull(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags, transformTo: GObject.Closure, transformFrom: GObject.Closure): GObject.Binding forceFloating(): void freezeNotify(): void getData(key: string): object | null getProperty(propertyName: string, value: GObject.Value): void getQdata(quark: GLib.Quark): object | null getv(names: string[], values: GObject.Value[]): void isFloating(): boolean notify(propertyName: string): void notifyByPspec(pspec: GObject.ParamSpec): void ref(): GObject.Object refSink(): GObject.Object runDispose(): void setData(key: string, data?: object | null): void setProperty(propertyName: string, value: GObject.Value): void stealData(key: string): object | null stealQdata(quark: GLib.Quark): object | null thawNotify(): void unref(): void watchClosure(closure: GObject.Closure): void /* Virtual methods of RygelServer.MediaFileItem */ vfuncGetPrimaryResource?(): MediaResource vfuncGetExtension?(): string vfuncAddEngineResources?(callback?: Gio.AsyncReadyCallback | null): void vfuncAddEngineResourcesFinish?(res: Gio.AsyncResult): void vfuncAddAdditionalResources?(server: HTTPServer): void /* Virtual methods of RygelServer.MediaObject */ vfuncAddUri?(uri: string): void vfuncSerialize?(serializer: Serializer, httpServer: HTTPServer): GUPnPAV.DIDLLiteObject | null vfuncCreateStreamSourceForResource?(request: HTTPRequest, resource: MediaResource): DataSource | null vfuncApplyDidlLite?(didlObject: GUPnPAV.DIDLLiteObject): void vfuncCompareByProperty?(mediaObject: MediaObject, property: string): number vfuncGetOcmFlags?(): GUPnPAV.OCMFlags /* Virtual methods of GObject.Object */ vfuncConstructed?(): void vfuncDispatchPropertiesChanged?(nPspecs: number, pspecs: GObject.ParamSpec): void vfuncDispose?(): void vfuncFinalize?(): void vfuncGetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void vfuncNotify?(pspec: GObject.ParamSpec): void vfuncSetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void /* Signals of GObject.Object */ connect(sigName: "notify", callback: (($obj: PhotoItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify", callback: (($obj: PhotoItem, pspec: GObject.ParamSpec) => void)): number emit(sigName: "notify", pspec: GObject.ParamSpec): void on(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::mime-type", callback: (($obj: PhotoItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::mime-type", callback: (($obj: PhotoItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::mime-type", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::mime-type", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::mime-type", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::dlna-profile", callback: (($obj: PhotoItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::dlna-profile", callback: (($obj: PhotoItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::dlna-profile", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::dlna-profile", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::dlna-profile", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::size", callback: (($obj: PhotoItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::size", callback: (($obj: PhotoItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::size", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::size", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::size", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::place-holder", callback: (($obj: PhotoItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::place-holder", callback: (($obj: PhotoItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::place-holder", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::place-holder", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::place-holder", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::description", callback: (($obj: PhotoItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::description", callback: (($obj: PhotoItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::description", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::description", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::description", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::id", callback: (($obj: PhotoItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::id", callback: (($obj: PhotoItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::id", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::id", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::id", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::ref-id", callback: (($obj: PhotoItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::ref-id", callback: (($obj: PhotoItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::ref-id", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::ref-id", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::ref-id", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::upnp-class", callback: (($obj: PhotoItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::upnp-class", callback: (($obj: PhotoItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::upnp-class", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::upnp-class", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::upnp-class", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::date", callback: (($obj: PhotoItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::date", callback: (($obj: PhotoItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::date", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::date", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::date", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::creator", callback: (($obj: PhotoItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::creator", callback: (($obj: PhotoItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::creator", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::creator", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::creator", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::modified", callback: (($obj: PhotoItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::modified", callback: (($obj: PhotoItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::modified", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::modified", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::modified", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::object-update-id", callback: (($obj: PhotoItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::object-update-id", callback: (($obj: PhotoItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::object-update-id", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::object-update-id", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::object-update-id", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::artist", callback: (($obj: PhotoItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::artist", callback: (($obj: PhotoItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::artist", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::artist", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::artist", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::genre", callback: (($obj: PhotoItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::genre", callback: (($obj: PhotoItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::genre", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::genre", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::genre", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::parent", callback: (($obj: PhotoItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::parent", callback: (($obj: PhotoItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::parent", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::parent", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::parent", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::parent-ref", callback: (($obj: PhotoItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::parent-ref", callback: (($obj: PhotoItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::parent-ref", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::parent-ref", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::parent-ref", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::title", callback: (($obj: PhotoItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::title", callback: (($obj: PhotoItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::title", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::title", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::title", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::ocm-flags", callback: (($obj: PhotoItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::ocm-flags", callback: (($obj: PhotoItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::ocm-flags", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::ocm-flags", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::ocm-flags", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: string, callback: any): number connect_after(sigName: string, callback: any): number emit(sigName: string, ...args: any[]): void disconnect(id: number): void on(sigName: string, callback: any): NodeJS.EventEmitter once(sigName: string, callback: any): NodeJS.EventEmitter off(sigName: string, callback: any): NodeJS.EventEmitter static name: string constructor (config?: PhotoItem_ConstructProps) _init (config?: PhotoItem_ConstructProps): void static new(id: string, parent: MediaContainer, title: string, upnpClass: string): PhotoItem static $gtype: GObject.Type } export class RelationalExpression { /* Fields of RygelServer.RelationalExpression */ /* Fields of RygelServer.SearchExpression */ refCount: number op: object | null operand1: object | null operand2: object | null /* Methods of RygelServer.RelationalExpression */ compareString(str?: string | null): boolean compareInt(integer: number): boolean compareUint(integer: number): boolean /* Methods of RygelServer.SearchExpression */ satisfiedBy(mediaObject: MediaObject): boolean /* Virtual methods of RygelServer.SearchExpression */ vfuncSatisfiedBy?(mediaObject: MediaObject): boolean vfuncToString?(): string static name: string static new(): RelationalExpression constructor() static new(): RelationalExpression } export interface SimpleContainer_ConstructProps extends MediaContainer_ConstructProps { } export class SimpleContainer { /* Properties of RygelServer.MediaContainer */ childCount: number emptyChildCount: number readonly allChildCount: number createModeEnabled: boolean sortCriteria: string /* Properties of RygelServer.MediaObject */ id: string refId: string upnpClass: string date: string creator: string modified: number objectUpdateId: number artist: string genre: string parent: MediaContainer parentRef: MediaContainer title: string readonly ocmFlags: GUPnPAV.OCMFlags /* Properties of RygelServer.SearchableContainer */ searchClasses: Gee.ArrayList /* Fields of RygelServer.SimpleContainer */ children: MediaObjects /* Fields of RygelServer.MediaContainer */ updateId: number storageUsed: number totalDeletedChildCount: number /* Fields of RygelServer.MediaObject */ parentPtr: MediaContainer /* Fields of GObject.Object */ gTypeInstance: GObject.TypeInstance /* Methods of RygelServer.SimpleContainer */ addChildItem(child: MediaItem): void getAllChildren(): MediaObjects addChildContainer(child: MediaContainer): void removeChild(child: MediaObject): void clear(): void isChildIdUnique(childId: string): boolean /* Methods of RygelServer.MediaContainer */ getChildren(offset: number, maxCount: number, sortCriteria: string, cancellable?: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback | null): void getChildrenFinish(res: Gio.AsyncResult): MediaObjects | null findObject(id: string, cancellable?: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback | null): void findObjectFinish(res: Gio.AsyncResult): MediaObject | null updated(object: MediaObject | null, eventType: ObjectEventType, subTreeUpdate: boolean): void getChildCount(): number setChildCount(value: number): void getEmptyChildCount(): number setEmptyChildCount(value: number): void getAllChildCount(): number getCreateModeEnabled(): boolean setCreateModeEnabled(value: boolean): void getSortCriteria(): string setSortCriteria(value: string): void /* Methods of RygelServer.MediaObject */ getUris(): Gee.List getPrimaryUri(): string | null addUri(uri: string): void getWritable(cancellable?: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback | null): void getWritableFinish(res: Gio.AsyncResult): Gio.File | null getWritables(cancellable?: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback | null): void getWritablesFinish(res: Gio.AsyncResult): Gee.ArrayList getResourceList(): Gee.List getResourceByName(resourceName: string): MediaResource | null serialize(serializer: Serializer, httpServer: HTTPServer): GUPnPAV.DIDLLiteObject | null serializeResourceList(didlObject: GUPnPAV.DIDLLiteObject, httpServer: HTTPServer): void createStreamSourceForResource(request: HTTPRequest, resource: MediaResource): DataSource | null applyDidlLite(didlObject: GUPnPAV.DIDLLiteObject): void compareByProperty(mediaObject: MediaObject, property: string): number compareStringProps(prop1: string, prop2: string): number compareIntProps(prop1: number, prop2: number): number getId(): string setId(value: string): void getRefId(): string setRefId(value: string): void getUpnpClass(): string setUpnpClass(value: string): void getDate(): string setDate(value: string): void getCreator(): string setCreator(value: string): void getModified(): number setModified(value: number): void getObjectUpdateId(): number setObjectUpdateId(value: number): void getArtist(): string setArtist(value: string): void getGenre(): string setGenre(value: string): void getParent(): MediaContainer setParent(value: MediaContainer): void getParentRef(): MediaContainer setParentRef(value: MediaContainer): void getTitle(): string setTitle(value: string): void getOcmFlags(): GUPnPAV.OCMFlags /* Methods of GObject.Object */ bindProperty(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags): GObject.Binding bindPropertyFull(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags, transformTo: GObject.Closure, transformFrom: GObject.Closure): GObject.Binding forceFloating(): void freezeNotify(): void getData(key: string): object | null getProperty(propertyName: string, value: GObject.Value): void getQdata(quark: GLib.Quark): object | null getv(names: string[], values: GObject.Value[]): void isFloating(): boolean notify(propertyName: string): void notifyByPspec(pspec: GObject.ParamSpec): void ref(): GObject.Object refSink(): GObject.Object runDispose(): void setData(key: string, data?: object | null): void setProperty(propertyName: string, value: GObject.Value): void stealData(key: string): object | null stealQdata(quark: GLib.Quark): object | null thawNotify(): void unref(): void watchClosure(closure: GObject.Closure): void /* Methods of RygelServer.SearchableContainer */ search(expression: SearchExpression | null, offset: number, maxCount: number, sortCriteria: string, cancellable?: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback | null): void searchFinish(res: Gio.AsyncResult): [ /* returnType */ MediaObjects | null, /* totalMatches */ number ] simpleSearch(expression: SearchExpression | null, offset: number, maxCount: number, sortCriteria: string, cancellable?: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback | null): void simpleSearchFinish(res: Gio.AsyncResult): [ /* returnType */ MediaObjects | null, /* totalMatches */ number ] getSearchClasses(): Gee.ArrayList setSearchClasses(value: Gee.ArrayList): void /* Virtual methods of RygelServer.MediaContainer */ vfuncGetChildren?(offset: number, maxCount: number, sortCriteria: string, cancellable?: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback | null): void vfuncGetChildrenFinish?(res: Gio.AsyncResult): MediaObjects | null vfuncFindObject?(id: string, cancellable?: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback | null): void vfuncFindObjectFinish?(res: Gio.AsyncResult): MediaObject | null /* Virtual methods of RygelServer.MediaObject */ vfuncAddUri?(uri: string): void vfuncSerialize?(serializer: Serializer, httpServer: HTTPServer): GUPnPAV.DIDLLiteObject | null vfuncCreateStreamSourceForResource?(request: HTTPRequest, resource: MediaResource): DataSource | null vfuncApplyDidlLite?(didlObject: GUPnPAV.DIDLLiteObject): void vfuncCompareByProperty?(mediaObject: MediaObject, property: string): number vfuncGetOcmFlags?(): GUPnPAV.OCMFlags /* Virtual methods of GObject.Object */ vfuncConstructed?(): void vfuncDispatchPropertiesChanged?(nPspecs: number, pspecs: GObject.ParamSpec): void vfuncDispose?(): void vfuncFinalize?(): void vfuncGetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void vfuncNotify?(pspec: GObject.ParamSpec): void vfuncSetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void /* Signals of RygelServer.MediaContainer */ connect(sigName: "container-updated", callback: (($obj: SimpleContainer, container: MediaContainer, object: MediaObject, eventType: ObjectEventType, subTreeUpdate: boolean) => void)): number connect_after(sigName: "container-updated", callback: (($obj: SimpleContainer, container: MediaContainer, object: MediaObject, eventType: ObjectEventType, subTreeUpdate: boolean) => void)): number emit(sigName: "container-updated", container: MediaContainer, object: MediaObject, eventType: ObjectEventType, subTreeUpdate: boolean): void on(sigName: "container-updated", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "container-updated", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "container-updated", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "sub-tree-updates-finished", callback: (($obj: SimpleContainer, subTreeRoot: MediaObject) => void)): number connect_after(sigName: "sub-tree-updates-finished", callback: (($obj: SimpleContainer, subTreeRoot: MediaObject) => void)): number emit(sigName: "sub-tree-updates-finished", subTreeRoot: MediaObject): void on(sigName: "sub-tree-updates-finished", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "sub-tree-updates-finished", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "sub-tree-updates-finished", callback: (...args: any[]) => void): NodeJS.EventEmitter /* Signals of GObject.Object */ connect(sigName: "notify", callback: (($obj: SimpleContainer, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify", callback: (($obj: SimpleContainer, pspec: GObject.ParamSpec) => void)): number emit(sigName: "notify", pspec: GObject.ParamSpec): void on(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::child-count", callback: (($obj: SimpleContainer, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::child-count", callback: (($obj: SimpleContainer, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::child-count", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::child-count", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::child-count", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::empty-child-count", callback: (($obj: SimpleContainer, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::empty-child-count", callback: (($obj: SimpleContainer, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::empty-child-count", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::empty-child-count", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::empty-child-count", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::all-child-count", callback: (($obj: SimpleContainer, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::all-child-count", callback: (($obj: SimpleContainer, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::all-child-count", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::all-child-count", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::all-child-count", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::create-mode-enabled", callback: (($obj: SimpleContainer, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::create-mode-enabled", callback: (($obj: SimpleContainer, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::create-mode-enabled", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::create-mode-enabled", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::create-mode-enabled", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::sort-criteria", callback: (($obj: SimpleContainer, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::sort-criteria", callback: (($obj: SimpleContainer, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::sort-criteria", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::sort-criteria", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::sort-criteria", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::id", callback: (($obj: SimpleContainer, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::id", callback: (($obj: SimpleContainer, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::id", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::id", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::id", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::ref-id", callback: (($obj: SimpleContainer, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::ref-id", callback: (($obj: SimpleContainer, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::ref-id", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::ref-id", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::ref-id", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::upnp-class", callback: (($obj: SimpleContainer, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::upnp-class", callback: (($obj: SimpleContainer, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::upnp-class", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::upnp-class", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::upnp-class", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::date", callback: (($obj: SimpleContainer, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::date", callback: (($obj: SimpleContainer, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::date", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::date", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::date", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::creator", callback: (($obj: SimpleContainer, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::creator", callback: (($obj: SimpleContainer, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::creator", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::creator", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::creator", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::modified", callback: (($obj: SimpleContainer, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::modified", callback: (($obj: SimpleContainer, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::modified", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::modified", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::modified", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::object-update-id", callback: (($obj: SimpleContainer, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::object-update-id", callback: (($obj: SimpleContainer, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::object-update-id", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::object-update-id", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::object-update-id", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::artist", callback: (($obj: SimpleContainer, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::artist", callback: (($obj: SimpleContainer, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::artist", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::artist", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::artist", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::genre", callback: (($obj: SimpleContainer, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::genre", callback: (($obj: SimpleContainer, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::genre", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::genre", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::genre", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::parent", callback: (($obj: SimpleContainer, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::parent", callback: (($obj: SimpleContainer, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::parent", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::parent", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::parent", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::parent-ref", callback: (($obj: SimpleContainer, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::parent-ref", callback: (($obj: SimpleContainer, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::parent-ref", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::parent-ref", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::parent-ref", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::title", callback: (($obj: SimpleContainer, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::title", callback: (($obj: SimpleContainer, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::title", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::title", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::title", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::ocm-flags", callback: (($obj: SimpleContainer, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::ocm-flags", callback: (($obj: SimpleContainer, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::ocm-flags", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::ocm-flags", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::ocm-flags", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::search-classes", callback: (($obj: SimpleContainer, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::search-classes", callback: (($obj: SimpleContainer, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::search-classes", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::search-classes", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::search-classes", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: string, callback: any): number connect_after(sigName: string, callback: any): number emit(sigName: string, ...args: any[]): void disconnect(id: number): void on(sigName: string, callback: any): NodeJS.EventEmitter once(sigName: string, callback: any): NodeJS.EventEmitter off(sigName: string, callback: any): NodeJS.EventEmitter static name: string constructor (config?: SimpleContainer_ConstructProps) _init (config?: SimpleContainer_ConstructProps): void static new(id: string, parent: MediaContainer | null, title: string): SimpleContainer static root(title: string): SimpleContainer static $gtype: GObject.Type } export class Subtitle { /* Fields of RygelServer.Subtitle */ refCount: number uri: string mimeType: string captionType: string fileExtension: string size: number /* Methods of RygelServer.Subtitle */ getResource(protocol: string, index: number): MediaResource /* Virtual methods of RygelServer.Subtitle */ vfuncGetResource?(protocol: string, index: number): MediaResource static name: string static new(mimeType: string, captionType: string, fileExtension: string): Subtitle constructor(mimeType: string, captionType: string, fileExtension: string) static new(mimeType: string, captionType: string, fileExtension: string): Subtitle } export class Thumbnail { /* Fields of RygelServer.Thumbnail */ dlnaProfile: string /* Fields of RygelCore.IconInfo */ refCount: number mimeType: string uri: string fileExtension: string size: number width: number height: number depth: number /* Methods of RygelServer.Thumbnail */ getResource(protocol: string, index: number): MediaResource /* Virtual methods of RygelServer.Thumbnail */ vfuncGetResource?(protocol: string, index: number): MediaResource static name: string static new(mimeType: string, dlnaProfile: string, fileExtension: string): Thumbnail constructor(mimeType: string, dlnaProfile: string, fileExtension: string) static new(mimeType: string, dlnaProfile: string, fileExtension: string): Thumbnail } export interface VideoItem_ConstructProps extends AudioItem_ConstructProps { author?: string subtitles?: Gee.ArrayList } export class VideoItem { /* Properties of RygelServer.VideoItem */ author: string subtitles: Gee.ArrayList /* Properties of RygelServer.AudioItem */ duration: number bitrate: number sampleFreq: number bitsPerSample: number channels: number album: string /* Properties of RygelServer.MediaFileItem */ mimeType: string dlnaProfile: string size: number placeHolder: boolean /* Properties of RygelServer.MediaItem */ description: string /* Properties of RygelServer.MediaObject */ id: string refId: string upnpClass: string date: string creator: string modified: number objectUpdateId: number artist: string genre: string parent: MediaContainer parentRef: MediaContainer title: string readonly ocmFlags: GUPnPAV.OCMFlags /* Properties of RygelServer.VisualItem */ width: number height: number colorDepth: number thumbnails: Gee.ArrayList /* Fields of RygelServer.VideoItem */ /* Fields of RygelServer.AudioItem */ /* Fields of RygelServer.MediaFileItem */ rygelMediaFileItemAddressRegex: GLib.Regex rygelMediaFileItemMimeToExt: Gee.HashMap /* Fields of RygelServer.MediaItem */ /* Fields of RygelServer.MediaObject */ parentPtr: MediaContainer /* Fields of GObject.Object */ gTypeInstance: GObject.TypeInstance /* Methods of RygelServer.VideoItem */ addSubtitleResources(httpServer: HTTPServer): void getAuthor(): string setAuthor(value: string): void getSubtitles(): Gee.ArrayList setSubtitles(value: Gee.ArrayList): void /* Methods of RygelServer.AudioItem */ getDuration(): number setDuration(value: number): void getBitrate(): number setBitrate(value: number): void getSampleFreq(): number setSampleFreq(value: number): void getBitsPerSample(): number setBitsPerSample(value: number): void getChannels(): number setChannels(value: number): void getAlbum(): string setAlbum(value: string): void /* Methods of RygelServer.MediaFileItem */ getPrimaryResource(): MediaResource getExtension(): string extFromMimeType(mimeType: string): string addEngineResources(callback?: Gio.AsyncReadyCallback | null): void addEngineResourcesFinish(res: Gio.AsyncResult): void addAdditionalResources(server: HTTPServer): void getMimeType(): string setMimeType(value: string): void getDlnaProfile(): string setDlnaProfile(value: string): void getSize(): number setSize(value: number): void getPlaceHolder(): boolean setPlaceHolder(value: boolean): void /* Methods of RygelServer.MediaItem */ getDescription(): string setDescription(value: string): void /* Methods of RygelServer.MediaObject */ getUris(): Gee.List getPrimaryUri(): string | null addUri(uri: string): void getWritable(cancellable?: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback | null): void getWritableFinish(res: Gio.AsyncResult): Gio.File | null getWritables(cancellable?: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback | null): void getWritablesFinish(res: Gio.AsyncResult): Gee.ArrayList getResourceList(): Gee.List getResourceByName(resourceName: string): MediaResource | null serialize(serializer: Serializer, httpServer: HTTPServer): GUPnPAV.DIDLLiteObject | null serializeResourceList(didlObject: GUPnPAV.DIDLLiteObject, httpServer: HTTPServer): void createStreamSourceForResource(request: HTTPRequest, resource: MediaResource): DataSource | null applyDidlLite(didlObject: GUPnPAV.DIDLLiteObject): void compareByProperty(mediaObject: MediaObject, property: string): number compareStringProps(prop1: string, prop2: string): number compareIntProps(prop1: number, prop2: number): number getId(): string setId(value: string): void getRefId(): string setRefId(value: string): void getUpnpClass(): string setUpnpClass(value: string): void getDate(): string setDate(value: string): void getCreator(): string setCreator(value: string): void getModified(): number setModified(value: number): void getObjectUpdateId(): number setObjectUpdateId(value: number): void getArtist(): string setArtist(value: string): void getGenre(): string setGenre(value: string): void getParent(): MediaContainer setParent(value: MediaContainer): void getParentRef(): MediaContainer setParentRef(value: MediaContainer): void getTitle(): string setTitle(value: string): void getOcmFlags(): GUPnPAV.OCMFlags /* Methods of GObject.Object */ bindProperty(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags): GObject.Binding bindPropertyFull(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags, transformTo: GObject.Closure, transformFrom: GObject.Closure): GObject.Binding forceFloating(): void freezeNotify(): void getData(key: string): object | null getProperty(propertyName: string, value: GObject.Value): void getQdata(quark: GLib.Quark): object | null getv(names: string[], values: GObject.Value[]): void isFloating(): boolean notify(propertyName: string): void notifyByPspec(pspec: GObject.ParamSpec): void ref(): GObject.Object refSink(): GObject.Object runDispose(): void setData(key: string, data?: object | null): void setProperty(propertyName: string, value: GObject.Value): void stealData(key: string): object | null stealQdata(quark: GLib.Quark): object | null thawNotify(): void unref(): void watchClosure(closure: GObject.Closure): void /* Methods of RygelServer.VisualItem */ getWidth(): number setWidth(value: number): void getHeight(): number setHeight(value: number): void getColorDepth(): number setColorDepth(value: number): void getThumbnails(): Gee.ArrayList setThumbnails(value: Gee.ArrayList): void /* Virtual methods of RygelServer.VideoItem */ vfuncAddSubtitleResources?(httpServer: HTTPServer): void /* Virtual methods of RygelServer.MediaFileItem */ vfuncGetPrimaryResource?(): MediaResource vfuncGetExtension?(): string vfuncAddEngineResources?(callback?: Gio.AsyncReadyCallback | null): void vfuncAddEngineResourcesFinish?(res: Gio.AsyncResult): void vfuncAddAdditionalResources?(server: HTTPServer): void /* Virtual methods of RygelServer.MediaObject */ vfuncAddUri?(uri: string): void vfuncSerialize?(serializer: Serializer, httpServer: HTTPServer): GUPnPAV.DIDLLiteObject | null vfuncCreateStreamSourceForResource?(request: HTTPRequest, resource: MediaResource): DataSource | null vfuncApplyDidlLite?(didlObject: GUPnPAV.DIDLLiteObject): void vfuncCompareByProperty?(mediaObject: MediaObject, property: string): number vfuncGetOcmFlags?(): GUPnPAV.OCMFlags /* Virtual methods of GObject.Object */ vfuncConstructed?(): void vfuncDispatchPropertiesChanged?(nPspecs: number, pspecs: GObject.ParamSpec): void vfuncDispose?(): void vfuncFinalize?(): void vfuncGetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void vfuncNotify?(pspec: GObject.ParamSpec): void vfuncSetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void /* Signals of GObject.Object */ connect(sigName: "notify", callback: (($obj: VideoItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify", callback: (($obj: VideoItem, pspec: GObject.ParamSpec) => void)): number emit(sigName: "notify", pspec: GObject.ParamSpec): void on(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::author", callback: (($obj: VideoItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::author", callback: (($obj: VideoItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::author", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::author", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::author", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::subtitles", callback: (($obj: VideoItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::subtitles", callback: (($obj: VideoItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::subtitles", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::subtitles", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::subtitles", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::duration", callback: (($obj: VideoItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::duration", callback: (($obj: VideoItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::duration", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::duration", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::duration", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::bitrate", callback: (($obj: VideoItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::bitrate", callback: (($obj: VideoItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::bitrate", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::bitrate", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::bitrate", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::sample-freq", callback: (($obj: VideoItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::sample-freq", callback: (($obj: VideoItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::sample-freq", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::sample-freq", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::sample-freq", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::bits-per-sample", callback: (($obj: VideoItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::bits-per-sample", callback: (($obj: VideoItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::bits-per-sample", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::bits-per-sample", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::bits-per-sample", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::channels", callback: (($obj: VideoItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::channels", callback: (($obj: VideoItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::channels", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::channels", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::channels", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::album", callback: (($obj: VideoItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::album", callback: (($obj: VideoItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::album", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::album", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::album", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::mime-type", callback: (($obj: VideoItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::mime-type", callback: (($obj: VideoItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::mime-type", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::mime-type", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::mime-type", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::dlna-profile", callback: (($obj: VideoItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::dlna-profile", callback: (($obj: VideoItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::dlna-profile", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::dlna-profile", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::dlna-profile", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::size", callback: (($obj: VideoItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::size", callback: (($obj: VideoItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::size", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::size", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::size", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::place-holder", callback: (($obj: VideoItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::place-holder", callback: (($obj: VideoItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::place-holder", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::place-holder", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::place-holder", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::description", callback: (($obj: VideoItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::description", callback: (($obj: VideoItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::description", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::description", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::description", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::id", callback: (($obj: VideoItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::id", callback: (($obj: VideoItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::id", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::id", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::id", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::ref-id", callback: (($obj: VideoItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::ref-id", callback: (($obj: VideoItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::ref-id", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::ref-id", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::ref-id", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::upnp-class", callback: (($obj: VideoItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::upnp-class", callback: (($obj: VideoItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::upnp-class", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::upnp-class", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::upnp-class", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::date", callback: (($obj: VideoItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::date", callback: (($obj: VideoItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::date", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::date", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::date", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::creator", callback: (($obj: VideoItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::creator", callback: (($obj: VideoItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::creator", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::creator", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::creator", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::modified", callback: (($obj: VideoItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::modified", callback: (($obj: VideoItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::modified", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::modified", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::modified", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::object-update-id", callback: (($obj: VideoItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::object-update-id", callback: (($obj: VideoItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::object-update-id", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::object-update-id", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::object-update-id", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::artist", callback: (($obj: VideoItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::artist", callback: (($obj: VideoItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::artist", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::artist", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::artist", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::genre", callback: (($obj: VideoItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::genre", callback: (($obj: VideoItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::genre", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::genre", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::genre", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::parent", callback: (($obj: VideoItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::parent", callback: (($obj: VideoItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::parent", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::parent", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::parent", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::parent-ref", callback: (($obj: VideoItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::parent-ref", callback: (($obj: VideoItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::parent-ref", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::parent-ref", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::parent-ref", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::title", callback: (($obj: VideoItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::title", callback: (($obj: VideoItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::title", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::title", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::title", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::ocm-flags", callback: (($obj: VideoItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::ocm-flags", callback: (($obj: VideoItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::ocm-flags", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::ocm-flags", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::ocm-flags", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::width", callback: (($obj: VideoItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::width", callback: (($obj: VideoItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::width", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::width", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::width", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::height", callback: (($obj: VideoItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::height", callback: (($obj: VideoItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::height", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::height", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::height", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::color-depth", callback: (($obj: VideoItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::color-depth", callback: (($obj: VideoItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::color-depth", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::color-depth", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::color-depth", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::thumbnails", callback: (($obj: VideoItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::thumbnails", callback: (($obj: VideoItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::thumbnails", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::thumbnails", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::thumbnails", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: string, callback: any): number connect_after(sigName: string, callback: any): number emit(sigName: string, ...args: any[]): void disconnect(id: number): void on(sigName: string, callback: any): NodeJS.EventEmitter once(sigName: string, callback: any): NodeJS.EventEmitter off(sigName: string, callback: any): NodeJS.EventEmitter static name: string constructor (config?: VideoItem_ConstructProps) _init (config?: VideoItem_ConstructProps): void static new(id: string, parent: MediaContainer, title: string, upnpClass: string): VideoItem static $gtype: GObject.Type } export interface MediaContainer_ConstructProps extends MediaObject_ConstructProps { childCount?: number emptyChildCount?: number createModeEnabled?: boolean sortCriteria?: string } export class MediaContainer { /* Properties of RygelServer.MediaContainer */ childCount: number emptyChildCount: number readonly allChildCount: number createModeEnabled: boolean sortCriteria: string /* Properties of RygelServer.MediaObject */ id: string refId: string upnpClass: string date: string creator: string modified: number objectUpdateId: number artist: string genre: string parent: MediaContainer parentRef: MediaContainer title: string readonly ocmFlags: GUPnPAV.OCMFlags /* Fields of RygelServer.MediaContainer */ updateId: number storageUsed: number totalDeletedChildCount: number /* Fields of RygelServer.MediaObject */ parentPtr: MediaContainer /* Fields of GObject.Object */ gTypeInstance: GObject.TypeInstance /* Methods of RygelServer.MediaContainer */ getChildren(offset: number, maxCount: number, sortCriteria: string, cancellable?: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback | null): void getChildrenFinish(res: Gio.AsyncResult): MediaObjects | null findObject(id: string, cancellable?: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback | null): void findObjectFinish(res: Gio.AsyncResult): MediaObject | null updated(object: MediaObject | null, eventType: ObjectEventType, subTreeUpdate: boolean): void getChildCount(): number setChildCount(value: number): void getEmptyChildCount(): number setEmptyChildCount(value: number): void getAllChildCount(): number getCreateModeEnabled(): boolean setCreateModeEnabled(value: boolean): void getSortCriteria(): string setSortCriteria(value: string): void /* Methods of RygelServer.MediaObject */ getUris(): Gee.List getPrimaryUri(): string | null addUri(uri: string): void getWritable(cancellable?: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback | null): void getWritableFinish(res: Gio.AsyncResult): Gio.File | null getWritables(cancellable?: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback | null): void getWritablesFinish(res: Gio.AsyncResult): Gee.ArrayList getResourceList(): Gee.List getResourceByName(resourceName: string): MediaResource | null serialize(serializer: Serializer, httpServer: HTTPServer): GUPnPAV.DIDLLiteObject | null serializeResourceList(didlObject: GUPnPAV.DIDLLiteObject, httpServer: HTTPServer): void createStreamSourceForResource(request: HTTPRequest, resource: MediaResource): DataSource | null applyDidlLite(didlObject: GUPnPAV.DIDLLiteObject): void compareByProperty(mediaObject: MediaObject, property: string): number compareStringProps(prop1: string, prop2: string): number compareIntProps(prop1: number, prop2: number): number getId(): string setId(value: string): void getRefId(): string setRefId(value: string): void getUpnpClass(): string setUpnpClass(value: string): void getDate(): string setDate(value: string): void getCreator(): string setCreator(value: string): void getModified(): number setModified(value: number): void getObjectUpdateId(): number setObjectUpdateId(value: number): void getArtist(): string setArtist(value: string): void getGenre(): string setGenre(value: string): void getParent(): MediaContainer setParent(value: MediaContainer): void getParentRef(): MediaContainer setParentRef(value: MediaContainer): void getTitle(): string setTitle(value: string): void getOcmFlags(): GUPnPAV.OCMFlags /* Methods of GObject.Object */ bindProperty(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags): GObject.Binding bindPropertyFull(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags, transformTo: GObject.Closure, transformFrom: GObject.Closure): GObject.Binding forceFloating(): void freezeNotify(): void getData(key: string): object | null getProperty(propertyName: string, value: GObject.Value): void getQdata(quark: GLib.Quark): object | null getv(names: string[], values: GObject.Value[]): void isFloating(): boolean notify(propertyName: string): void notifyByPspec(pspec: GObject.ParamSpec): void ref(): GObject.Object refSink(): GObject.Object runDispose(): void setData(key: string, data?: object | null): void setProperty(propertyName: string, value: GObject.Value): void stealData(key: string): object | null stealQdata(quark: GLib.Quark): object | null thawNotify(): void unref(): void watchClosure(closure: GObject.Closure): void /* Virtual methods of RygelServer.MediaContainer */ vfuncGetChildren?(offset: number, maxCount: number, sortCriteria: string, cancellable?: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback | null): void vfuncGetChildrenFinish?(res: Gio.AsyncResult): MediaObjects | null vfuncFindObject?(id: string, cancellable?: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback | null): void vfuncFindObjectFinish?(res: Gio.AsyncResult): MediaObject | null /* Virtual methods of RygelServer.MediaObject */ vfuncAddUri?(uri: string): void vfuncSerialize?(serializer: Serializer, httpServer: HTTPServer): GUPnPAV.DIDLLiteObject | null vfuncCreateStreamSourceForResource?(request: HTTPRequest, resource: MediaResource): DataSource | null vfuncApplyDidlLite?(didlObject: GUPnPAV.DIDLLiteObject): void vfuncCompareByProperty?(mediaObject: MediaObject, property: string): number vfuncGetOcmFlags?(): GUPnPAV.OCMFlags /* Virtual methods of GObject.Object */ vfuncConstructed?(): void vfuncDispatchPropertiesChanged?(nPspecs: number, pspecs: GObject.ParamSpec): void vfuncDispose?(): void vfuncFinalize?(): void vfuncGetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void vfuncNotify?(pspec: GObject.ParamSpec): void vfuncSetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void /* Signals of RygelServer.MediaContainer */ connect(sigName: "container-updated", callback: (($obj: MediaContainer, container: MediaContainer, object: MediaObject, eventType: ObjectEventType, subTreeUpdate: boolean) => void)): number connect_after(sigName: "container-updated", callback: (($obj: MediaContainer, container: MediaContainer, object: MediaObject, eventType: ObjectEventType, subTreeUpdate: boolean) => void)): number emit(sigName: "container-updated", container: MediaContainer, object: MediaObject, eventType: ObjectEventType, subTreeUpdate: boolean): void on(sigName: "container-updated", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "container-updated", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "container-updated", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "sub-tree-updates-finished", callback: (($obj: MediaContainer, subTreeRoot: MediaObject) => void)): number connect_after(sigName: "sub-tree-updates-finished", callback: (($obj: MediaContainer, subTreeRoot: MediaObject) => void)): number emit(sigName: "sub-tree-updates-finished", subTreeRoot: MediaObject): void on(sigName: "sub-tree-updates-finished", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "sub-tree-updates-finished", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "sub-tree-updates-finished", callback: (...args: any[]) => void): NodeJS.EventEmitter /* Signals of GObject.Object */ connect(sigName: "notify", callback: (($obj: MediaContainer, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify", callback: (($obj: MediaContainer, pspec: GObject.ParamSpec) => void)): number emit(sigName: "notify", pspec: GObject.ParamSpec): void on(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::child-count", callback: (($obj: MediaContainer, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::child-count", callback: (($obj: MediaContainer, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::child-count", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::child-count", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::child-count", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::empty-child-count", callback: (($obj: MediaContainer, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::empty-child-count", callback: (($obj: MediaContainer, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::empty-child-count", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::empty-child-count", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::empty-child-count", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::all-child-count", callback: (($obj: MediaContainer, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::all-child-count", callback: (($obj: MediaContainer, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::all-child-count", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::all-child-count", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::all-child-count", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::create-mode-enabled", callback: (($obj: MediaContainer, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::create-mode-enabled", callback: (($obj: MediaContainer, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::create-mode-enabled", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::create-mode-enabled", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::create-mode-enabled", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::sort-criteria", callback: (($obj: MediaContainer, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::sort-criteria", callback: (($obj: MediaContainer, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::sort-criteria", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::sort-criteria", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::sort-criteria", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::id", callback: (($obj: MediaContainer, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::id", callback: (($obj: MediaContainer, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::id", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::id", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::id", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::ref-id", callback: (($obj: MediaContainer, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::ref-id", callback: (($obj: MediaContainer, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::ref-id", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::ref-id", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::ref-id", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::upnp-class", callback: (($obj: MediaContainer, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::upnp-class", callback: (($obj: MediaContainer, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::upnp-class", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::upnp-class", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::upnp-class", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::date", callback: (($obj: MediaContainer, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::date", callback: (($obj: MediaContainer, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::date", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::date", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::date", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::creator", callback: (($obj: MediaContainer, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::creator", callback: (($obj: MediaContainer, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::creator", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::creator", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::creator", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::modified", callback: (($obj: MediaContainer, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::modified", callback: (($obj: MediaContainer, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::modified", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::modified", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::modified", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::object-update-id", callback: (($obj: MediaContainer, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::object-update-id", callback: (($obj: MediaContainer, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::object-update-id", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::object-update-id", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::object-update-id", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::artist", callback: (($obj: MediaContainer, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::artist", callback: (($obj: MediaContainer, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::artist", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::artist", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::artist", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::genre", callback: (($obj: MediaContainer, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::genre", callback: (($obj: MediaContainer, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::genre", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::genre", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::genre", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::parent", callback: (($obj: MediaContainer, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::parent", callback: (($obj: MediaContainer, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::parent", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::parent", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::parent", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::parent-ref", callback: (($obj: MediaContainer, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::parent-ref", callback: (($obj: MediaContainer, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::parent-ref", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::parent-ref", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::parent-ref", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::title", callback: (($obj: MediaContainer, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::title", callback: (($obj: MediaContainer, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::title", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::title", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::title", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::ocm-flags", callback: (($obj: MediaContainer, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::ocm-flags", callback: (($obj: MediaContainer, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::ocm-flags", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::ocm-flags", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::ocm-flags", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: string, callback: any): number connect_after(sigName: string, callback: any): number emit(sigName: string, ...args: any[]): void disconnect(id: number): void on(sigName: string, callback: any): NodeJS.EventEmitter once(sigName: string, callback: any): NodeJS.EventEmitter off(sigName: string, callback: any): NodeJS.EventEmitter static name: string constructor (config?: MediaContainer_ConstructProps) _init (config?: MediaContainer_ConstructProps): void static equalFunc(a: MediaContainer, b: MediaContainer): boolean static $gtype: GObject.Type } export interface MediaItem_ConstructProps extends MediaObject_ConstructProps { description?: string } export class MediaItem { /* Properties of RygelServer.MediaItem */ description: string /* Properties of RygelServer.MediaObject */ id: string refId: string upnpClass: string date: string creator: string modified: number objectUpdateId: number artist: string genre: string parent: MediaContainer parentRef: MediaContainer title: string readonly ocmFlags: GUPnPAV.OCMFlags /* Fields of RygelServer.MediaItem */ /* Fields of RygelServer.MediaObject */ parentPtr: MediaContainer /* Fields of GObject.Object */ gTypeInstance: GObject.TypeInstance /* Methods of RygelServer.MediaItem */ getDescription(): string setDescription(value: string): void /* Methods of RygelServer.MediaObject */ getUris(): Gee.List getPrimaryUri(): string | null addUri(uri: string): void getWritable(cancellable?: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback | null): void getWritableFinish(res: Gio.AsyncResult): Gio.File | null getWritables(cancellable?: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback | null): void getWritablesFinish(res: Gio.AsyncResult): Gee.ArrayList getResourceList(): Gee.List getResourceByName(resourceName: string): MediaResource | null serialize(serializer: Serializer, httpServer: HTTPServer): GUPnPAV.DIDLLiteObject | null serializeResourceList(didlObject: GUPnPAV.DIDLLiteObject, httpServer: HTTPServer): void createStreamSourceForResource(request: HTTPRequest, resource: MediaResource): DataSource | null applyDidlLite(didlObject: GUPnPAV.DIDLLiteObject): void compareByProperty(mediaObject: MediaObject, property: string): number compareStringProps(prop1: string, prop2: string): number compareIntProps(prop1: number, prop2: number): number getId(): string setId(value: string): void getRefId(): string setRefId(value: string): void getUpnpClass(): string setUpnpClass(value: string): void getDate(): string setDate(value: string): void getCreator(): string setCreator(value: string): void getModified(): number setModified(value: number): void getObjectUpdateId(): number setObjectUpdateId(value: number): void getArtist(): string setArtist(value: string): void getGenre(): string setGenre(value: string): void getParent(): MediaContainer setParent(value: MediaContainer): void getParentRef(): MediaContainer setParentRef(value: MediaContainer): void getTitle(): string setTitle(value: string): void getOcmFlags(): GUPnPAV.OCMFlags /* Methods of GObject.Object */ bindProperty(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags): GObject.Binding bindPropertyFull(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags, transformTo: GObject.Closure, transformFrom: GObject.Closure): GObject.Binding forceFloating(): void freezeNotify(): void getData(key: string): object | null getProperty(propertyName: string, value: GObject.Value): void getQdata(quark: GLib.Quark): object | null getv(names: string[], values: GObject.Value[]): void isFloating(): boolean notify(propertyName: string): void notifyByPspec(pspec: GObject.ParamSpec): void ref(): GObject.Object refSink(): GObject.Object runDispose(): void setData(key: string, data?: object | null): void setProperty(propertyName: string, value: GObject.Value): void stealData(key: string): object | null stealQdata(quark: GLib.Quark): object | null thawNotify(): void unref(): void watchClosure(closure: GObject.Closure): void /* Virtual methods of RygelServer.MediaObject */ vfuncAddUri?(uri: string): void vfuncSerialize?(serializer: Serializer, httpServer: HTTPServer): GUPnPAV.DIDLLiteObject | null vfuncCreateStreamSourceForResource?(request: HTTPRequest, resource: MediaResource): DataSource | null vfuncApplyDidlLite?(didlObject: GUPnPAV.DIDLLiteObject): void vfuncCompareByProperty?(mediaObject: MediaObject, property: string): number vfuncGetOcmFlags?(): GUPnPAV.OCMFlags /* Virtual methods of GObject.Object */ vfuncConstructed?(): void vfuncDispatchPropertiesChanged?(nPspecs: number, pspecs: GObject.ParamSpec): void vfuncDispose?(): void vfuncFinalize?(): void vfuncGetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void vfuncNotify?(pspec: GObject.ParamSpec): void vfuncSetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void /* Signals of GObject.Object */ connect(sigName: "notify", callback: (($obj: MediaItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify", callback: (($obj: MediaItem, pspec: GObject.ParamSpec) => void)): number emit(sigName: "notify", pspec: GObject.ParamSpec): void on(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::description", callback: (($obj: MediaItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::description", callback: (($obj: MediaItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::description", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::description", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::description", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::id", callback: (($obj: MediaItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::id", callback: (($obj: MediaItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::id", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::id", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::id", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::ref-id", callback: (($obj: MediaItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::ref-id", callback: (($obj: MediaItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::ref-id", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::ref-id", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::ref-id", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::upnp-class", callback: (($obj: MediaItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::upnp-class", callback: (($obj: MediaItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::upnp-class", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::upnp-class", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::upnp-class", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::date", callback: (($obj: MediaItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::date", callback: (($obj: MediaItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::date", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::date", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::date", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::creator", callback: (($obj: MediaItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::creator", callback: (($obj: MediaItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::creator", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::creator", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::creator", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::modified", callback: (($obj: MediaItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::modified", callback: (($obj: MediaItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::modified", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::modified", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::modified", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::object-update-id", callback: (($obj: MediaItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::object-update-id", callback: (($obj: MediaItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::object-update-id", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::object-update-id", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::object-update-id", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::artist", callback: (($obj: MediaItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::artist", callback: (($obj: MediaItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::artist", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::artist", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::artist", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::genre", callback: (($obj: MediaItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::genre", callback: (($obj: MediaItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::genre", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::genre", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::genre", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::parent", callback: (($obj: MediaItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::parent", callback: (($obj: MediaItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::parent", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::parent", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::parent", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::parent-ref", callback: (($obj: MediaItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::parent-ref", callback: (($obj: MediaItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::parent-ref", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::parent-ref", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::parent-ref", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::title", callback: (($obj: MediaItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::title", callback: (($obj: MediaItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::title", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::title", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::title", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::ocm-flags", callback: (($obj: MediaItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::ocm-flags", callback: (($obj: MediaItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::ocm-flags", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::ocm-flags", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::ocm-flags", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: string, callback: any): number connect_after(sigName: string, callback: any): number emit(sigName: string, ...args: any[]): void disconnect(id: number): void on(sigName: string, callback: any): NodeJS.EventEmitter once(sigName: string, callback: any): NodeJS.EventEmitter off(sigName: string, callback: any): NodeJS.EventEmitter static name: string constructor (config?: MediaItem_ConstructProps) _init (config?: MediaItem_ConstructProps): void static $gtype: GObject.Type } export interface MediaFileItem_ConstructProps extends MediaItem_ConstructProps { mimeType?: string dlnaProfile?: string size?: number placeHolder?: boolean } export class MediaFileItem { /* Properties of RygelServer.MediaFileItem */ mimeType: string dlnaProfile: string size: number placeHolder: boolean /* Properties of RygelServer.MediaItem */ description: string /* Properties of RygelServer.MediaObject */ id: string refId: string upnpClass: string date: string creator: string modified: number objectUpdateId: number artist: string genre: string parent: MediaContainer parentRef: MediaContainer title: string readonly ocmFlags: GUPnPAV.OCMFlags /* Fields of RygelServer.MediaFileItem */ rygelMediaFileItemAddressRegex: GLib.Regex rygelMediaFileItemMimeToExt: Gee.HashMap /* Fields of RygelServer.MediaItem */ /* Fields of RygelServer.MediaObject */ parentPtr: MediaContainer /* Fields of GObject.Object */ gTypeInstance: GObject.TypeInstance /* Methods of RygelServer.MediaFileItem */ getPrimaryResource(): MediaResource getExtension(): string extFromMimeType(mimeType: string): string addEngineResources(callback?: Gio.AsyncReadyCallback | null): void addEngineResourcesFinish(res: Gio.AsyncResult): void addAdditionalResources(server: HTTPServer): void getMimeType(): string setMimeType(value: string): void getDlnaProfile(): string setDlnaProfile(value: string): void getSize(): number setSize(value: number): void getPlaceHolder(): boolean setPlaceHolder(value: boolean): void /* Methods of RygelServer.MediaItem */ getDescription(): string setDescription(value: string): void /* Methods of RygelServer.MediaObject */ getUris(): Gee.List getPrimaryUri(): string | null addUri(uri: string): void getWritable(cancellable?: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback | null): void getWritableFinish(res: Gio.AsyncResult): Gio.File | null getWritables(cancellable?: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback | null): void getWritablesFinish(res: Gio.AsyncResult): Gee.ArrayList getResourceList(): Gee.List getResourceByName(resourceName: string): MediaResource | null serialize(serializer: Serializer, httpServer: HTTPServer): GUPnPAV.DIDLLiteObject | null serializeResourceList(didlObject: GUPnPAV.DIDLLiteObject, httpServer: HTTPServer): void createStreamSourceForResource(request: HTTPRequest, resource: MediaResource): DataSource | null applyDidlLite(didlObject: GUPnPAV.DIDLLiteObject): void compareByProperty(mediaObject: MediaObject, property: string): number compareStringProps(prop1: string, prop2: string): number compareIntProps(prop1: number, prop2: number): number getId(): string setId(value: string): void getRefId(): string setRefId(value: string): void getUpnpClass(): string setUpnpClass(value: string): void getDate(): string setDate(value: string): void getCreator(): string setCreator(value: string): void getModified(): number setModified(value: number): void getObjectUpdateId(): number setObjectUpdateId(value: number): void getArtist(): string setArtist(value: string): void getGenre(): string setGenre(value: string): void getParent(): MediaContainer setParent(value: MediaContainer): void getParentRef(): MediaContainer setParentRef(value: MediaContainer): void getTitle(): string setTitle(value: string): void getOcmFlags(): GUPnPAV.OCMFlags /* Methods of GObject.Object */ bindProperty(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags): GObject.Binding bindPropertyFull(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags, transformTo: GObject.Closure, transformFrom: GObject.Closure): GObject.Binding forceFloating(): void freezeNotify(): void getData(key: string): object | null getProperty(propertyName: string, value: GObject.Value): void getQdata(quark: GLib.Quark): object | null getv(names: string[], values: GObject.Value[]): void isFloating(): boolean notify(propertyName: string): void notifyByPspec(pspec: GObject.ParamSpec): void ref(): GObject.Object refSink(): GObject.Object runDispose(): void setData(key: string, data?: object | null): void setProperty(propertyName: string, value: GObject.Value): void stealData(key: string): object | null stealQdata(quark: GLib.Quark): object | null thawNotify(): void unref(): void watchClosure(closure: GObject.Closure): void /* Virtual methods of RygelServer.MediaFileItem */ vfuncGetPrimaryResource?(): MediaResource vfuncGetExtension?(): string vfuncAddEngineResources?(callback?: Gio.AsyncReadyCallback | null): void vfuncAddEngineResourcesFinish?(res: Gio.AsyncResult): void vfuncAddAdditionalResources?(server: HTTPServer): void /* Virtual methods of RygelServer.MediaObject */ vfuncAddUri?(uri: string): void vfuncSerialize?(serializer: Serializer, httpServer: HTTPServer): GUPnPAV.DIDLLiteObject | null vfuncCreateStreamSourceForResource?(request: HTTPRequest, resource: MediaResource): DataSource | null vfuncApplyDidlLite?(didlObject: GUPnPAV.DIDLLiteObject): void vfuncCompareByProperty?(mediaObject: MediaObject, property: string): number vfuncGetOcmFlags?(): GUPnPAV.OCMFlags /* Virtual methods of GObject.Object */ vfuncConstructed?(): void vfuncDispatchPropertiesChanged?(nPspecs: number, pspecs: GObject.ParamSpec): void vfuncDispose?(): void vfuncFinalize?(): void vfuncGetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void vfuncNotify?(pspec: GObject.ParamSpec): void vfuncSetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void /* Signals of GObject.Object */ connect(sigName: "notify", callback: (($obj: MediaFileItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify", callback: (($obj: MediaFileItem, pspec: GObject.ParamSpec) => void)): number emit(sigName: "notify", pspec: GObject.ParamSpec): void on(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::mime-type", callback: (($obj: MediaFileItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::mime-type", callback: (($obj: MediaFileItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::mime-type", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::mime-type", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::mime-type", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::dlna-profile", callback: (($obj: MediaFileItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::dlna-profile", callback: (($obj: MediaFileItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::dlna-profile", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::dlna-profile", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::dlna-profile", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::size", callback: (($obj: MediaFileItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::size", callback: (($obj: MediaFileItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::size", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::size", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::size", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::place-holder", callback: (($obj: MediaFileItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::place-holder", callback: (($obj: MediaFileItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::place-holder", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::place-holder", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::place-holder", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::description", callback: (($obj: MediaFileItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::description", callback: (($obj: MediaFileItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::description", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::description", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::description", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::id", callback: (($obj: MediaFileItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::id", callback: (($obj: MediaFileItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::id", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::id", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::id", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::ref-id", callback: (($obj: MediaFileItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::ref-id", callback: (($obj: MediaFileItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::ref-id", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::ref-id", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::ref-id", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::upnp-class", callback: (($obj: MediaFileItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::upnp-class", callback: (($obj: MediaFileItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::upnp-class", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::upnp-class", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::upnp-class", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::date", callback: (($obj: MediaFileItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::date", callback: (($obj: MediaFileItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::date", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::date", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::date", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::creator", callback: (($obj: MediaFileItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::creator", callback: (($obj: MediaFileItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::creator", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::creator", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::creator", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::modified", callback: (($obj: MediaFileItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::modified", callback: (($obj: MediaFileItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::modified", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::modified", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::modified", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::object-update-id", callback: (($obj: MediaFileItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::object-update-id", callback: (($obj: MediaFileItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::object-update-id", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::object-update-id", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::object-update-id", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::artist", callback: (($obj: MediaFileItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::artist", callback: (($obj: MediaFileItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::artist", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::artist", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::artist", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::genre", callback: (($obj: MediaFileItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::genre", callback: (($obj: MediaFileItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::genre", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::genre", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::genre", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::parent", callback: (($obj: MediaFileItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::parent", callback: (($obj: MediaFileItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::parent", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::parent", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::parent", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::parent-ref", callback: (($obj: MediaFileItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::parent-ref", callback: (($obj: MediaFileItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::parent-ref", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::parent-ref", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::parent-ref", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::title", callback: (($obj: MediaFileItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::title", callback: (($obj: MediaFileItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::title", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::title", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::title", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::ocm-flags", callback: (($obj: MediaFileItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::ocm-flags", callback: (($obj: MediaFileItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::ocm-flags", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::ocm-flags", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::ocm-flags", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: string, callback: any): number connect_after(sigName: string, callback: any): number emit(sigName: string, ...args: any[]): void disconnect(id: number): void on(sigName: string, callback: any): NodeJS.EventEmitter once(sigName: string, callback: any): NodeJS.EventEmitter off(sigName: string, callback: any): NodeJS.EventEmitter static name: string constructor (config?: MediaFileItem_ConstructProps) _init (config?: MediaFileItem_ConstructProps): void static $gtype: GObject.Type } export interface MediaObject_ConstructProps extends GObject.Object_ConstructProps { id?: string refId?: string upnpClass?: string date?: string creator?: string modified?: number objectUpdateId?: number artist?: string genre?: string parent?: MediaContainer parentRef?: MediaContainer title?: string } export class MediaObject { /* Properties of RygelServer.MediaObject */ id: string refId: string upnpClass: string date: string creator: string modified: number objectUpdateId: number artist: string genre: string parent: MediaContainer parentRef: MediaContainer title: string readonly ocmFlags: GUPnPAV.OCMFlags /* Fields of RygelServer.MediaObject */ parentPtr: MediaContainer /* Fields of GObject.Object */ gTypeInstance: GObject.TypeInstance /* Methods of RygelServer.MediaObject */ getUris(): Gee.List getPrimaryUri(): string | null addUri(uri: string): void getWritable(cancellable?: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback | null): void getWritableFinish(res: Gio.AsyncResult): Gio.File | null getWritables(cancellable?: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback | null): void getWritablesFinish(res: Gio.AsyncResult): Gee.ArrayList getResourceList(): Gee.List getResourceByName(resourceName: string): MediaResource | null serialize(serializer: Serializer, httpServer: HTTPServer): GUPnPAV.DIDLLiteObject | null serializeResourceList(didlObject: GUPnPAV.DIDLLiteObject, httpServer: HTTPServer): void createStreamSourceForResource(request: HTTPRequest, resource: MediaResource): DataSource | null applyDidlLite(didlObject: GUPnPAV.DIDLLiteObject): void compareByProperty(mediaObject: MediaObject, property: string): number compareStringProps(prop1: string, prop2: string): number compareIntProps(prop1: number, prop2: number): number getId(): string setId(value: string): void getRefId(): string setRefId(value: string): void getUpnpClass(): string setUpnpClass(value: string): void getDate(): string setDate(value: string): void getCreator(): string setCreator(value: string): void getModified(): number setModified(value: number): void getObjectUpdateId(): number setObjectUpdateId(value: number): void getArtist(): string setArtist(value: string): void getGenre(): string setGenre(value: string): void getParent(): MediaContainer setParent(value: MediaContainer): void getParentRef(): MediaContainer setParentRef(value: MediaContainer): void getTitle(): string setTitle(value: string): void getOcmFlags(): GUPnPAV.OCMFlags /* Methods of GObject.Object */ bindProperty(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags): GObject.Binding bindPropertyFull(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags, transformTo: GObject.Closure, transformFrom: GObject.Closure): GObject.Binding forceFloating(): void freezeNotify(): void getData(key: string): object | null getProperty(propertyName: string, value: GObject.Value): void getQdata(quark: GLib.Quark): object | null getv(names: string[], values: GObject.Value[]): void isFloating(): boolean notify(propertyName: string): void notifyByPspec(pspec: GObject.ParamSpec): void ref(): GObject.Object refSink(): GObject.Object runDispose(): void setData(key: string, data?: object | null): void setProperty(propertyName: string, value: GObject.Value): void stealData(key: string): object | null stealQdata(quark: GLib.Quark): object | null thawNotify(): void unref(): void watchClosure(closure: GObject.Closure): void /* Virtual methods of RygelServer.MediaObject */ vfuncAddUri?(uri: string): void vfuncSerialize?(serializer: Serializer, httpServer: HTTPServer): GUPnPAV.DIDLLiteObject | null vfuncCreateStreamSourceForResource?(request: HTTPRequest, resource: MediaResource): DataSource | null vfuncApplyDidlLite?(didlObject: GUPnPAV.DIDLLiteObject): void vfuncCompareByProperty?(mediaObject: MediaObject, property: string): number vfuncGetOcmFlags?(): GUPnPAV.OCMFlags /* Virtual methods of GObject.Object */ vfuncConstructed?(): void vfuncDispatchPropertiesChanged?(nPspecs: number, pspecs: GObject.ParamSpec): void vfuncDispose?(): void vfuncFinalize?(): void vfuncGetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void vfuncNotify?(pspec: GObject.ParamSpec): void vfuncSetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void /* Signals of GObject.Object */ connect(sigName: "notify", callback: (($obj: MediaObject, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify", callback: (($obj: MediaObject, pspec: GObject.ParamSpec) => void)): number emit(sigName: "notify", pspec: GObject.ParamSpec): void on(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::id", callback: (($obj: MediaObject, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::id", callback: (($obj: MediaObject, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::id", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::id", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::id", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::ref-id", callback: (($obj: MediaObject, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::ref-id", callback: (($obj: MediaObject, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::ref-id", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::ref-id", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::ref-id", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::upnp-class", callback: (($obj: MediaObject, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::upnp-class", callback: (($obj: MediaObject, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::upnp-class", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::upnp-class", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::upnp-class", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::date", callback: (($obj: MediaObject, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::date", callback: (($obj: MediaObject, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::date", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::date", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::date", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::creator", callback: (($obj: MediaObject, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::creator", callback: (($obj: MediaObject, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::creator", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::creator", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::creator", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::modified", callback: (($obj: MediaObject, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::modified", callback: (($obj: MediaObject, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::modified", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::modified", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::modified", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::object-update-id", callback: (($obj: MediaObject, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::object-update-id", callback: (($obj: MediaObject, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::object-update-id", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::object-update-id", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::object-update-id", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::artist", callback: (($obj: MediaObject, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::artist", callback: (($obj: MediaObject, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::artist", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::artist", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::artist", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::genre", callback: (($obj: MediaObject, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::genre", callback: (($obj: MediaObject, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::genre", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::genre", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::genre", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::parent", callback: (($obj: MediaObject, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::parent", callback: (($obj: MediaObject, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::parent", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::parent", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::parent", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::parent-ref", callback: (($obj: MediaObject, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::parent-ref", callback: (($obj: MediaObject, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::parent-ref", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::parent-ref", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::parent-ref", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::title", callback: (($obj: MediaObject, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::title", callback: (($obj: MediaObject, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::title", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::title", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::title", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::ocm-flags", callback: (($obj: MediaObject, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::ocm-flags", callback: (($obj: MediaObject, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::ocm-flags", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::ocm-flags", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::ocm-flags", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: string, callback: any): number connect_after(sigName: string, callback: any): number emit(sigName: string, ...args: any[]): void disconnect(id: number): void on(sigName: string, callback: any): NodeJS.EventEmitter once(sigName: string, callback: any): NodeJS.EventEmitter off(sigName: string, callback: any): NodeJS.EventEmitter static name: string constructor (config?: MediaObject_ConstructProps) _init (config?: MediaObject_ConstructProps): void static applyReplacements(replacementPairs: GLib.HashTable, sourceString?: string | null): string | null static $gtype: GObject.Type } export interface MediaResource_ConstructProps extends GObject.Object_ConstructProps { uri?: string importUri?: string extension?: string size?: number cleartextSize?: number duration?: number bitrate?: number bitsPerSample?: number colorDepth?: number width?: number height?: number audioChannels?: number sampleFreq?: number protocol?: string mimeType?: string dlnaProfile?: string network?: string dlnaConversion?: GUPnPAV.DLNAConversion dlnaFlags?: GUPnPAV.DLNAFlags dlnaOperation?: GUPnPAV.DLNAOperation } export class MediaResource { /* Properties of RygelServer.MediaResource */ uri: string importUri: string extension: string size: number cleartextSize: number duration: number bitrate: number bitsPerSample: number colorDepth: number width: number height: number audioChannels: number sampleFreq: number protocol: string mimeType: string dlnaProfile: string network: string dlnaConversion: GUPnPAV.DLNAConversion dlnaFlags: GUPnPAV.DLNAFlags dlnaOperation: GUPnPAV.DLNAOperation /* Fields of RygelServer.MediaResource */ playSpeeds: string[] playSpeedsLength1: number /* Fields of GObject.Object */ gTypeInstance: GObject.TypeInstance /* Methods of RygelServer.MediaResource */ dup(): MediaResource getName(): string serialize(didlResource: GUPnPAV.DIDLLiteResource, replacements?: GLib.HashTable | null): GUPnPAV.DIDLLiteResource setProtocolInfo(pi: GUPnPAV.ProtocolInfo): void getProtocolInfo(replacements?: GLib.HashTable | null): GUPnPAV.ProtocolInfo supportsArbitraryByteSeek(): boolean supportsArbitraryTimeSeek(): boolean supportsLimitedByteSeek(): boolean supportsLimitedTimeSeek(): boolean supportsLimitedCleartextByteSeek(): boolean supportsFullCleartextByteSeek(): boolean isLinkProtectionEnabled(): boolean isDlnaContent(): boolean getDefaultTransferMode(): string supportsTransferMode(transferMode: string): boolean isStreamable(): boolean isCleartextRangeSupportEnabled(): boolean supportsPlayspeed(): boolean isDlnaProtocolFlagSet(flags: number): boolean isDlnaOperationModeSet(flags: number): boolean getUri(): string setUri(value: string): void getImportUri(): string setImportUri(value: string): void getExtension(): string setExtension(value: string): void getSize(): number setSize(value: number): void getCleartextSize(): number setCleartextSize(value: number): void getDuration(): number setDuration(value: number): void getBitrate(): number setBitrate(value: number): void getBitsPerSample(): number setBitsPerSample(value: number): void getColorDepth(): number setColorDepth(value: number): void getWidth(): number setWidth(value: number): void getHeight(): number setHeight(value: number): void getAudioChannels(): number setAudioChannels(value: number): void getSampleFreq(): number setSampleFreq(value: number): void getProtocol(): string setProtocol(value: string): void getMimeType(): string setMimeType(value: string): void getDlnaProfile(): string setDlnaProfile(value: string): void getNetwork(): string setNetwork(value: string): void getDlnaConversion(): GUPnPAV.DLNAConversion setDlnaConversion(value: GUPnPAV.DLNAConversion): void getDlnaFlags(): GUPnPAV.DLNAFlags setDlnaFlags(value: GUPnPAV.DLNAFlags): void getDlnaOperation(): GUPnPAV.DLNAOperation setDlnaOperation(value: GUPnPAV.DLNAOperation): void /* Methods of GObject.Object */ bindProperty(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags): GObject.Binding bindPropertyFull(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags, transformTo: GObject.Closure, transformFrom: GObject.Closure): GObject.Binding forceFloating(): void freezeNotify(): void getData(key: string): object | null getProperty(propertyName: string, value: GObject.Value): void getQdata(quark: GLib.Quark): object | null getv(names: string[], values: GObject.Value[]): void isFloating(): boolean notify(propertyName: string): void notifyByPspec(pspec: GObject.ParamSpec): void ref(): GObject.Object refSink(): GObject.Object runDispose(): void setData(key: string, data?: object | null): void setProperty(propertyName: string, value: GObject.Value): void stealData(key: string): object | null stealQdata(quark: GLib.Quark): object | null thawNotify(): void unref(): void watchClosure(closure: GObject.Closure): void /* Virtual methods of GObject.Object */ vfuncConstructed?(): void vfuncDispatchPropertiesChanged?(nPspecs: number, pspecs: GObject.ParamSpec): void vfuncDispose?(): void vfuncFinalize?(): void vfuncGetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void vfuncNotify?(pspec: GObject.ParamSpec): void vfuncSetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void /* Signals of GObject.Object */ connect(sigName: "notify", callback: (($obj: MediaResource, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify", callback: (($obj: MediaResource, pspec: GObject.ParamSpec) => void)): number emit(sigName: "notify", pspec: GObject.ParamSpec): void on(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::uri", callback: (($obj: MediaResource, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::uri", callback: (($obj: MediaResource, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::uri", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::uri", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::uri", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::import-uri", callback: (($obj: MediaResource, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::import-uri", callback: (($obj: MediaResource, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::import-uri", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::import-uri", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::import-uri", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::extension", callback: (($obj: MediaResource, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::extension", callback: (($obj: MediaResource, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::extension", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::extension", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::extension", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::size", callback: (($obj: MediaResource, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::size", callback: (($obj: MediaResource, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::size", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::size", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::size", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::cleartext-size", callback: (($obj: MediaResource, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::cleartext-size", callback: (($obj: MediaResource, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::cleartext-size", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::cleartext-size", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::cleartext-size", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::duration", callback: (($obj: MediaResource, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::duration", callback: (($obj: MediaResource, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::duration", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::duration", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::duration", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::bitrate", callback: (($obj: MediaResource, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::bitrate", callback: (($obj: MediaResource, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::bitrate", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::bitrate", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::bitrate", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::bits-per-sample", callback: (($obj: MediaResource, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::bits-per-sample", callback: (($obj: MediaResource, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::bits-per-sample", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::bits-per-sample", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::bits-per-sample", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::color-depth", callback: (($obj: MediaResource, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::color-depth", callback: (($obj: MediaResource, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::color-depth", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::color-depth", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::color-depth", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::width", callback: (($obj: MediaResource, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::width", callback: (($obj: MediaResource, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::width", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::width", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::width", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::height", callback: (($obj: MediaResource, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::height", callback: (($obj: MediaResource, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::height", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::height", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::height", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::audio-channels", callback: (($obj: MediaResource, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::audio-channels", callback: (($obj: MediaResource, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::audio-channels", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::audio-channels", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::audio-channels", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::sample-freq", callback: (($obj: MediaResource, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::sample-freq", callback: (($obj: MediaResource, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::sample-freq", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::sample-freq", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::sample-freq", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::protocol", callback: (($obj: MediaResource, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::protocol", callback: (($obj: MediaResource, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::protocol", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::protocol", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::protocol", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::mime-type", callback: (($obj: MediaResource, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::mime-type", callback: (($obj: MediaResource, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::mime-type", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::mime-type", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::mime-type", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::dlna-profile", callback: (($obj: MediaResource, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::dlna-profile", callback: (($obj: MediaResource, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::dlna-profile", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::dlna-profile", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::dlna-profile", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::network", callback: (($obj: MediaResource, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::network", callback: (($obj: MediaResource, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::network", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::network", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::network", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::dlna-conversion", callback: (($obj: MediaResource, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::dlna-conversion", callback: (($obj: MediaResource, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::dlna-conversion", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::dlna-conversion", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::dlna-conversion", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::dlna-flags", callback: (($obj: MediaResource, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::dlna-flags", callback: (($obj: MediaResource, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::dlna-flags", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::dlna-flags", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::dlna-flags", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::dlna-operation", callback: (($obj: MediaResource, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::dlna-operation", callback: (($obj: MediaResource, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::dlna-operation", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::dlna-operation", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::dlna-operation", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: string, callback: any): number connect_after(sigName: string, callback: any): number emit(sigName: string, ...args: any[]): void disconnect(id: number): void on(sigName: string, callback: any): NodeJS.EventEmitter once(sigName: string, callback: any): NodeJS.EventEmitter off(sigName: string, callback: any): NodeJS.EventEmitter static name: string constructor (config?: MediaResource_ConstructProps) _init (config?: MediaResource_ConstructProps): void static new(name: string): MediaResource static fromResource(name: string, that: MediaResource): MediaResource static fromDidlLiteResource(name: string, didlResource: GUPnPAV.DIDLLiteResource): MediaResource static $gtype: GObject.Type } export interface MediaServerPlugin_ConstructProps extends RygelCore.Plugin_ConstructProps { rootContainer?: MediaContainer uploadProfiles?: RygelCore.DLNAProfile[] supportedProfiles?: RygelCore.DLNAProfile[] } export class MediaServerPlugin { /* Properties of RygelServer.MediaServerPlugin */ readonly searchCaps: string uploadProfiles: RygelCore.DLNAProfile[] supportedProfiles: RygelCore.DLNAProfile[] /* Properties of RygelCore.Plugin */ capabilities: RygelCore.PluginCapabilities title: string active: boolean resourceInfos: Gee.ArrayList iconInfos: Gee.ArrayList defaultIcons: Gee.ArrayList /* Fields of RygelServer.MediaServerPlugin */ /* Fields of RygelCore.Plugin */ /* Fields of GUPnP.ResourceFactory */ parentInstance: GObject.Object /* Fields of GObject.Object */ gTypeInstance: GObject.TypeInstance /* Methods of RygelServer.MediaServerPlugin */ getRootContainer(): MediaContainer getSearchCaps(): string getUploadProfiles(): RygelCore.DLNAProfile[] setUploadProfiles(value: RygelCore.DLNAProfile[]): void getSupportedProfiles(): RygelCore.DLNAProfile[] setSupportedProfiles(value: RygelCore.DLNAProfile[]): void /* Methods of RygelCore.Plugin */ addResource(resourceInfo: RygelCore.ResourceInfo): void addIcon(iconInfo: RygelCore.IconInfo): void applyHacks(device: RygelCore.RootDevice, descriptionPath: string): void getCapabilities(): RygelCore.PluginCapabilities setCapabilities(value: RygelCore.PluginCapabilities): void getName(): string getTitle(): string setTitle(value: string): void getDescription(): string getDescPath(): string getActive(): boolean setActive(value: boolean): void getResourceInfos(): Gee.ArrayList getIconInfos(): Gee.ArrayList getDefaultIcons(): Gee.ArrayList /* Methods of GUPnP.ResourceFactory */ registerResourceProxyType(upnpType: string, type: GObject.Type): void registerResourceType(upnpType: string, type: GObject.Type): void unregisterResourceProxyType(upnpType: string): boolean unregisterResourceType(upnpType: string): boolean /* Methods of GObject.Object */ bindProperty(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags): GObject.Binding bindPropertyFull(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags, transformTo: GObject.Closure, transformFrom: GObject.Closure): GObject.Binding forceFloating(): void freezeNotify(): void getData(key: string): object | null getProperty(propertyName: string, value: GObject.Value): void getQdata(quark: GLib.Quark): object | null getv(names: string[], values: GObject.Value[]): void isFloating(): boolean notify(propertyName: string): void notifyByPspec(pspec: GObject.ParamSpec): void ref(): GObject.Object refSink(): GObject.Object runDispose(): void setData(key: string, data?: object | null): void setProperty(propertyName: string, value: GObject.Value): void stealData(key: string): object | null stealQdata(quark: GLib.Quark): object | null thawNotify(): void unref(): void watchClosure(closure: GObject.Closure): void /* Virtual methods of RygelServer.MediaServerPlugin */ vfuncGetSearchCaps?(): string /* Virtual methods of RygelCore.Plugin */ vfuncApplyHacks?(device: RygelCore.RootDevice, descriptionPath: string): void /* Virtual methods of GObject.Object */ vfuncConstructed?(): void vfuncDispatchPropertiesChanged?(nPspecs: number, pspecs: GObject.ParamSpec): void vfuncDispose?(): void vfuncFinalize?(): void vfuncGetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void vfuncNotify?(pspec: GObject.ParamSpec): void vfuncSetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void /* Signals of GObject.Object */ connect(sigName: "notify", callback: (($obj: MediaServerPlugin, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify", callback: (($obj: MediaServerPlugin, pspec: GObject.ParamSpec) => void)): number emit(sigName: "notify", pspec: GObject.ParamSpec): void on(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::search-caps", callback: (($obj: MediaServerPlugin, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::search-caps", callback: (($obj: MediaServerPlugin, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::search-caps", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::search-caps", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::search-caps", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::upload-profiles", callback: (($obj: MediaServerPlugin, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::upload-profiles", callback: (($obj: MediaServerPlugin, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::upload-profiles", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::upload-profiles", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::upload-profiles", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::supported-profiles", callback: (($obj: MediaServerPlugin, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::supported-profiles", callback: (($obj: MediaServerPlugin, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::supported-profiles", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::supported-profiles", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::supported-profiles", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::capabilities", callback: (($obj: MediaServerPlugin, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::capabilities", callback: (($obj: MediaServerPlugin, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::capabilities", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::capabilities", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::capabilities", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::title", callback: (($obj: MediaServerPlugin, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::title", callback: (($obj: MediaServerPlugin, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::title", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::title", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::title", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::active", callback: (($obj: MediaServerPlugin, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::active", callback: (($obj: MediaServerPlugin, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::active", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::active", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::active", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::resource-infos", callback: (($obj: MediaServerPlugin, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::resource-infos", callback: (($obj: MediaServerPlugin, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::resource-infos", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::resource-infos", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::resource-infos", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::icon-infos", callback: (($obj: MediaServerPlugin, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::icon-infos", callback: (($obj: MediaServerPlugin, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::icon-infos", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::icon-infos", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::icon-infos", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::default-icons", callback: (($obj: MediaServerPlugin, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::default-icons", callback: (($obj: MediaServerPlugin, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::default-icons", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::default-icons", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::default-icons", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: string, callback: any): number connect_after(sigName: string, callback: any): number emit(sigName: string, ...args: any[]): void disconnect(id: number): void on(sigName: string, callback: any): NodeJS.EventEmitter once(sigName: string, callback: any): NodeJS.EventEmitter off(sigName: string, callback: any): NodeJS.EventEmitter static name: string constructor (config?: MediaServerPlugin_ConstructProps) _init (config?: MediaServerPlugin_ConstructProps): void static $gtype: GObject.Type } export class SearchExpression { /* Fields of RygelServer.SearchExpression */ refCount: number op: object | null operand1: object | null operand2: object | null /* Methods of RygelServer.SearchExpression */ satisfiedBy(mediaObject: MediaObject): boolean /* Virtual methods of RygelServer.SearchExpression */ vfuncSatisfiedBy?(mediaObject: MediaObject): boolean vfuncToString?(): string static name: string } export interface MediaServer_ConstructProps extends RygelCore.MediaDevice_ConstructProps { rootContainer?: MediaContainer } export class MediaServer { /* Properties of RygelServer.MediaServer */ /* Properties of RygelCore.MediaDevice */ plugin: RygelCore.Plugin /* Fields of RygelServer.MediaServer */ /* Fields of RygelCore.MediaDevice */ /* Fields of GObject.Object */ gTypeInstance: GObject.TypeInstance /* Methods of RygelCore.MediaDevice */ addInterface(iface: string): void removeInterface(iface: string): void getInterfaces(): string[] getPlugin(): RygelCore.Plugin setPlugin(value: RygelCore.Plugin): void getTitle(): string getCapabilities(): RygelCore.PluginCapabilities /* Methods of GObject.Object */ bindProperty(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags): GObject.Binding bindPropertyFull(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags, transformTo: GObject.Closure, transformFrom: GObject.Closure): GObject.Binding forceFloating(): void freezeNotify(): void getData(key: string): object | null getProperty(propertyName: string, value: GObject.Value): void getQdata(quark: GLib.Quark): object | null getv(names: string[], values: GObject.Value[]): void isFloating(): boolean notify(propertyName: string): void notifyByPspec(pspec: GObject.ParamSpec): void ref(): GObject.Object refSink(): GObject.Object runDispose(): void setData(key: string, data?: object | null): void setProperty(propertyName: string, value: GObject.Value): void stealData(key: string): object | null stealQdata(quark: GLib.Quark): object | null thawNotify(): void unref(): void watchClosure(closure: GObject.Closure): void /* Virtual methods of GObject.Object */ vfuncConstructed?(): void vfuncDispatchPropertiesChanged?(nPspecs: number, pspecs: GObject.ParamSpec): void vfuncDispose?(): void vfuncFinalize?(): void vfuncGetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void vfuncNotify?(pspec: GObject.ParamSpec): void vfuncSetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void /* Signals of GObject.Object */ connect(sigName: "notify", callback: (($obj: MediaServer, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify", callback: (($obj: MediaServer, pspec: GObject.ParamSpec) => void)): number emit(sigName: "notify", pspec: GObject.ParamSpec): void on(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::plugin", callback: (($obj: MediaServer, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::plugin", callback: (($obj: MediaServer, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::plugin", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::plugin", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::plugin", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: string, callback: any): number connect_after(sigName: string, callback: any): number emit(sigName: string, ...args: any[]): void disconnect(id: number): void on(sigName: string, callback: any): NodeJS.EventEmitter once(sigName: string, callback: any): NodeJS.EventEmitter off(sigName: string, callback: any): NodeJS.EventEmitter static name: string constructor (config?: MediaServer_ConstructProps) _init (config?: MediaServer_ConstructProps): void static new(title: string, rootContainer: MediaContainer, capabilities: RygelCore.PluginCapabilities): MediaServer static $gtype: GObject.Type } export interface MediaEngine_ConstructProps extends GObject.Object_ConstructProps { } export class MediaEngine { /* Fields of RygelServer.MediaEngine */ /* Fields of GObject.Object */ gTypeInstance: GObject.TypeInstance /* Methods of RygelServer.MediaEngine */ getDlnaProfiles(): RygelCore.DLNAProfile[] getResourcesForItem(item: MediaObject, callback?: Gio.AsyncReadyCallback | null): void getResourcesForItemFinish(res: Gio.AsyncResult): Gee.List | null createDataSourceForResource(item: MediaObject, resource: MediaResource, replacements: GLib.HashTable): DataSource | null createDataSourceForUri(uri: string): DataSource | null getInternalProtocolSchemes(): string[] /* Methods of GObject.Object */ bindProperty(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags): GObject.Binding bindPropertyFull(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags, transformTo: GObject.Closure, transformFrom: GObject.Closure): GObject.Binding forceFloating(): void freezeNotify(): void getData(key: string): object | null getProperty(propertyName: string, value: GObject.Value): void getQdata(quark: GLib.Quark): object | null getv(names: string[], values: GObject.Value[]): void isFloating(): boolean notify(propertyName: string): void notifyByPspec(pspec: GObject.ParamSpec): void ref(): GObject.Object refSink(): GObject.Object runDispose(): void setData(key: string, data?: object | null): void setProperty(propertyName: string, value: GObject.Value): void stealData(key: string): object | null stealQdata(quark: GLib.Quark): object | null thawNotify(): void unref(): void watchClosure(closure: GObject.Closure): void /* Virtual methods of RygelServer.MediaEngine */ vfuncGetDlnaProfiles?(): RygelCore.DLNAProfile[] vfuncGetResourcesForItem?(item: MediaObject, callback?: Gio.AsyncReadyCallback | null): void vfuncGetResourcesForItemFinish?(res: Gio.AsyncResult): Gee.List | null vfuncCreateDataSourceForResource?(item: MediaObject, resource: MediaResource, replacements: GLib.HashTable): DataSource | null vfuncCreateDataSourceForUri?(uri: string): DataSource | null vfuncGetInternalProtocolSchemes?(): string[] /* Virtual methods of GObject.Object */ vfuncConstructed?(): void vfuncDispatchPropertiesChanged?(nPspecs: number, pspecs: GObject.ParamSpec): void vfuncDispose?(): void vfuncFinalize?(): void vfuncGetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void vfuncNotify?(pspec: GObject.ParamSpec): void vfuncSetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void /* Signals of RygelServer.MediaEngine */ connect(sigName: "resource-changed", callback: (($obj: MediaEngine, mediaObjectUri: string) => void)): number connect_after(sigName: "resource-changed", callback: (($obj: MediaEngine, mediaObjectUri: string) => void)): number emit(sigName: "resource-changed", mediaObjectUri: string): void on(sigName: "resource-changed", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "resource-changed", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "resource-changed", callback: (...args: any[]) => void): NodeJS.EventEmitter /* Signals of GObject.Object */ connect(sigName: "notify", callback: (($obj: MediaEngine, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify", callback: (($obj: MediaEngine, pspec: GObject.ParamSpec) => void)): number emit(sigName: "notify", pspec: GObject.ParamSpec): void on(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: string, callback: any): number connect_after(sigName: string, callback: any): number emit(sigName: string, ...args: any[]): void disconnect(id: number): void on(sigName: string, callback: any): NodeJS.EventEmitter once(sigName: string, callback: any): NodeJS.EventEmitter off(sigName: string, callback: any): NodeJS.EventEmitter static name: string constructor (config?: MediaEngine_ConstructProps) _init (config?: MediaEngine_ConstructProps): void static init(): void static getDefault(): MediaEngine static $gtype: GObject.Type } export interface HTTPSeekRequest_ConstructProps extends GObject.Object_ConstructProps { } export class HTTPSeekRequest { /* Fields of RygelServer.HTTPSeekRequest */ /* Fields of GObject.Object */ gTypeInstance: GObject.TypeInstance /* Methods of GObject.Object */ bindProperty(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags): GObject.Binding bindPropertyFull(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags, transformTo: GObject.Closure, transformFrom: GObject.Closure): GObject.Binding forceFloating(): void freezeNotify(): void getData(key: string): object | null getProperty(propertyName: string, value: GObject.Value): void getQdata(quark: GLib.Quark): object | null getv(names: string[], values: GObject.Value[]): void isFloating(): boolean notify(propertyName: string): void notifyByPspec(pspec: GObject.ParamSpec): void ref(): GObject.Object refSink(): GObject.Object runDispose(): void setData(key: string, data?: object | null): void setProperty(propertyName: string, value: GObject.Value): void stealData(key: string): object | null stealQdata(quark: GLib.Quark): object | null thawNotify(): void unref(): void watchClosure(closure: GObject.Closure): void /* Virtual methods of GObject.Object */ vfuncConstructed?(): void vfuncDispatchPropertiesChanged?(nPspecs: number, pspecs: GObject.ParamSpec): void vfuncDispose?(): void vfuncFinalize?(): void vfuncGetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void vfuncNotify?(pspec: GObject.ParamSpec): void vfuncSetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void /* Signals of GObject.Object */ connect(sigName: "notify", callback: (($obj: HTTPSeekRequest, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify", callback: (($obj: HTTPSeekRequest, pspec: GObject.ParamSpec) => void)): number emit(sigName: "notify", pspec: GObject.ParamSpec): void on(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: string, callback: any): number connect_after(sigName: string, callback: any): number emit(sigName: string, ...args: any[]): void disconnect(id: number): void on(sigName: string, callback: any): NodeJS.EventEmitter once(sigName: string, callback: any): NodeJS.EventEmitter off(sigName: string, callback: any): NodeJS.EventEmitter static name: string constructor (config?: HTTPSeekRequest_ConstructProps) _init (config?: HTTPSeekRequest_ConstructProps): void static $gtype: GObject.Type } export interface PlaylistItem_ConstructProps extends MediaFileItem_ConstructProps { } export class PlaylistItem { /* Properties of RygelServer.MediaFileItem */ mimeType: string dlnaProfile: string size: number placeHolder: boolean /* Properties of RygelServer.MediaItem */ description: string /* Properties of RygelServer.MediaObject */ id: string refId: string upnpClass: string date: string creator: string modified: number objectUpdateId: number artist: string genre: string parent: MediaContainer parentRef: MediaContainer title: string readonly ocmFlags: GUPnPAV.OCMFlags /* Fields of RygelServer.PlaylistItem */ /* Fields of RygelServer.MediaFileItem */ rygelMediaFileItemAddressRegex: GLib.Regex rygelMediaFileItemMimeToExt: Gee.HashMap /* Fields of RygelServer.MediaItem */ /* Fields of RygelServer.MediaObject */ parentPtr: MediaContainer /* Fields of GObject.Object */ gTypeInstance: GObject.TypeInstance /* Methods of RygelServer.MediaFileItem */ getPrimaryResource(): MediaResource getExtension(): string extFromMimeType(mimeType: string): string addEngineResources(callback?: Gio.AsyncReadyCallback | null): void addEngineResourcesFinish(res: Gio.AsyncResult): void addAdditionalResources(server: HTTPServer): void getMimeType(): string setMimeType(value: string): void getDlnaProfile(): string setDlnaProfile(value: string): void getSize(): number setSize(value: number): void getPlaceHolder(): boolean setPlaceHolder(value: boolean): void /* Methods of RygelServer.MediaItem */ getDescription(): string setDescription(value: string): void /* Methods of RygelServer.MediaObject */ getUris(): Gee.List getPrimaryUri(): string | null addUri(uri: string): void getWritable(cancellable?: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback | null): void getWritableFinish(res: Gio.AsyncResult): Gio.File | null getWritables(cancellable?: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback | null): void getWritablesFinish(res: Gio.AsyncResult): Gee.ArrayList getResourceList(): Gee.List getResourceByName(resourceName: string): MediaResource | null serialize(serializer: Serializer, httpServer: HTTPServer): GUPnPAV.DIDLLiteObject | null serializeResourceList(didlObject: GUPnPAV.DIDLLiteObject, httpServer: HTTPServer): void createStreamSourceForResource(request: HTTPRequest, resource: MediaResource): DataSource | null applyDidlLite(didlObject: GUPnPAV.DIDLLiteObject): void compareByProperty(mediaObject: MediaObject, property: string): number compareStringProps(prop1: string, prop2: string): number compareIntProps(prop1: number, prop2: number): number getId(): string setId(value: string): void getRefId(): string setRefId(value: string): void getUpnpClass(): string setUpnpClass(value: string): void getDate(): string setDate(value: string): void getCreator(): string setCreator(value: string): void getModified(): number setModified(value: number): void getObjectUpdateId(): number setObjectUpdateId(value: number): void getArtist(): string setArtist(value: string): void getGenre(): string setGenre(value: string): void getParent(): MediaContainer setParent(value: MediaContainer): void getParentRef(): MediaContainer setParentRef(value: MediaContainer): void getTitle(): string setTitle(value: string): void getOcmFlags(): GUPnPAV.OCMFlags /* Methods of GObject.Object */ bindProperty(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags): GObject.Binding bindPropertyFull(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags, transformTo: GObject.Closure, transformFrom: GObject.Closure): GObject.Binding forceFloating(): void freezeNotify(): void getData(key: string): object | null getProperty(propertyName: string, value: GObject.Value): void getQdata(quark: GLib.Quark): object | null getv(names: string[], values: GObject.Value[]): void isFloating(): boolean notify(propertyName: string): void notifyByPspec(pspec: GObject.ParamSpec): void ref(): GObject.Object refSink(): GObject.Object runDispose(): void setData(key: string, data?: object | null): void setProperty(propertyName: string, value: GObject.Value): void stealData(key: string): object | null stealQdata(quark: GLib.Quark): object | null thawNotify(): void unref(): void watchClosure(closure: GObject.Closure): void /* Virtual methods of RygelServer.MediaFileItem */ vfuncGetPrimaryResource?(): MediaResource vfuncGetExtension?(): string vfuncAddEngineResources?(callback?: Gio.AsyncReadyCallback | null): void vfuncAddEngineResourcesFinish?(res: Gio.AsyncResult): void vfuncAddAdditionalResources?(server: HTTPServer): void /* Virtual methods of RygelServer.MediaObject */ vfuncAddUri?(uri: string): void vfuncSerialize?(serializer: Serializer, httpServer: HTTPServer): GUPnPAV.DIDLLiteObject | null vfuncCreateStreamSourceForResource?(request: HTTPRequest, resource: MediaResource): DataSource | null vfuncApplyDidlLite?(didlObject: GUPnPAV.DIDLLiteObject): void vfuncCompareByProperty?(mediaObject: MediaObject, property: string): number vfuncGetOcmFlags?(): GUPnPAV.OCMFlags /* Virtual methods of GObject.Object */ vfuncConstructed?(): void vfuncDispatchPropertiesChanged?(nPspecs: number, pspecs: GObject.ParamSpec): void vfuncDispose?(): void vfuncFinalize?(): void vfuncGetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void vfuncNotify?(pspec: GObject.ParamSpec): void vfuncSetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void /* Signals of GObject.Object */ connect(sigName: "notify", callback: (($obj: PlaylistItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify", callback: (($obj: PlaylistItem, pspec: GObject.ParamSpec) => void)): number emit(sigName: "notify", pspec: GObject.ParamSpec): void on(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::mime-type", callback: (($obj: PlaylistItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::mime-type", callback: (($obj: PlaylistItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::mime-type", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::mime-type", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::mime-type", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::dlna-profile", callback: (($obj: PlaylistItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::dlna-profile", callback: (($obj: PlaylistItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::dlna-profile", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::dlna-profile", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::dlna-profile", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::size", callback: (($obj: PlaylistItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::size", callback: (($obj: PlaylistItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::size", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::size", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::size", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::place-holder", callback: (($obj: PlaylistItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::place-holder", callback: (($obj: PlaylistItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::place-holder", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::place-holder", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::place-holder", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::description", callback: (($obj: PlaylistItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::description", callback: (($obj: PlaylistItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::description", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::description", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::description", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::id", callback: (($obj: PlaylistItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::id", callback: (($obj: PlaylistItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::id", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::id", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::id", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::ref-id", callback: (($obj: PlaylistItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::ref-id", callback: (($obj: PlaylistItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::ref-id", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::ref-id", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::ref-id", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::upnp-class", callback: (($obj: PlaylistItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::upnp-class", callback: (($obj: PlaylistItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::upnp-class", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::upnp-class", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::upnp-class", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::date", callback: (($obj: PlaylistItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::date", callback: (($obj: PlaylistItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::date", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::date", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::date", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::creator", callback: (($obj: PlaylistItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::creator", callback: (($obj: PlaylistItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::creator", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::creator", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::creator", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::modified", callback: (($obj: PlaylistItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::modified", callback: (($obj: PlaylistItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::modified", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::modified", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::modified", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::object-update-id", callback: (($obj: PlaylistItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::object-update-id", callback: (($obj: PlaylistItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::object-update-id", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::object-update-id", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::object-update-id", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::artist", callback: (($obj: PlaylistItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::artist", callback: (($obj: PlaylistItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::artist", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::artist", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::artist", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::genre", callback: (($obj: PlaylistItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::genre", callback: (($obj: PlaylistItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::genre", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::genre", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::genre", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::parent", callback: (($obj: PlaylistItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::parent", callback: (($obj: PlaylistItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::parent", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::parent", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::parent", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::parent-ref", callback: (($obj: PlaylistItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::parent-ref", callback: (($obj: PlaylistItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::parent-ref", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::parent-ref", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::parent-ref", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::title", callback: (($obj: PlaylistItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::title", callback: (($obj: PlaylistItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::title", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::title", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::title", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::ocm-flags", callback: (($obj: PlaylistItem, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::ocm-flags", callback: (($obj: PlaylistItem, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::ocm-flags", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::ocm-flags", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::ocm-flags", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: string, callback: any): number connect_after(sigName: string, callback: any): number emit(sigName: string, ...args: any[]): void disconnect(id: number): void on(sigName: string, callback: any): NodeJS.EventEmitter once(sigName: string, callback: any): NodeJS.EventEmitter off(sigName: string, callback: any): NodeJS.EventEmitter static name: string constructor (config?: PlaylistItem_ConstructProps) _init (config?: PlaylistItem_ConstructProps): void static new(id: string, parent: MediaContainer, title: string, upnpClass: string): PlaylistItem static $gtype: GObject.Type } export interface ContentDirectory_ConstructProps extends GUPnP.Service_ConstructProps { } export class ContentDirectory { /* Properties of GUPnP.Service */ /* Properties of GUPnP.ServiceInfo */ /* Fields of RygelServer.ContentDirectory */ featureList: string httpServer: HTTPServer rootContainer: MediaContainer cancellable: Gio.Cancellable systemUpdateId: number /* Fields of GUPnP.Service */ parentInstance: GUPnP.ServiceInfo /* Fields of GUPnP.ServiceInfo */ /* Fields of GObject.Object */ gTypeInstance: GObject.TypeInstance /* Methods of GUPnP.Service */ freezeNotify(): void notifyValue(variable: string, value: any): void signalsAutoconnect(userData?: object | null): void thawNotify(): void /* Methods of GUPnP.ServiceInfo */ getContext(): GUPnP.Context getControlUrl(): string getEventSubscriptionUrl(): string getId(): string getIntrospectionAsync(callback: GUPnP.ServiceIntrospectionCallback): void getIntrospectionAsyncFull(callback: GUPnP.ServiceIntrospectionCallback, cancellable?: Gio.Cancellable | null): void getLocation(): string getScpdUrl(): string getServiceType(): string getUdn(): string getUrlBase(): Soup.URI introspectAsync(cancellable?: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback | null): void introspectFinish(res: Gio.AsyncResult): GUPnP.ServiceIntrospection /* Methods of GObject.Object */ bindProperty(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags): GObject.Binding bindPropertyFull(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags, transformTo: GObject.Closure, transformFrom: GObject.Closure): GObject.Binding forceFloating(): void getData(key: string): object | null getProperty(propertyName: string, value: GObject.Value): void getQdata(quark: GLib.Quark): object | null getv(names: string[], values: GObject.Value[]): void isFloating(): boolean notify(propertyName: string): void notifyByPspec(pspec: GObject.ParamSpec): void ref(): GObject.Object refSink(): GObject.Object runDispose(): void setData(key: string, data?: object | null): void setProperty(propertyName: string, value: GObject.Value): void stealData(key: string): object | null stealQdata(quark: GLib.Quark): object | null unref(): void watchClosure(closure: GObject.Closure): void /* Virtual methods of GUPnP.Service */ vfuncActionInvoked?(action: GUPnP.ServiceAction): void vfuncQueryVariable?(variable: string, value: any): void /* Virtual methods of GObject.Object */ vfuncConstructed?(): void vfuncDispatchPropertiesChanged?(nPspecs: number, pspecs: GObject.ParamSpec): void vfuncDispose?(): void vfuncFinalize?(): void vfuncGetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void vfuncNotify?(pspec: GObject.ParamSpec): void vfuncSetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void /* Signals of GUPnP.Service */ connect(sigName: "action-invoked", callback: (($obj: ContentDirectory, action: GUPnP.ServiceAction) => void)): number connect_after(sigName: "action-invoked", callback: (($obj: ContentDirectory, action: GUPnP.ServiceAction) => void)): number emit(sigName: "action-invoked", action: GUPnP.ServiceAction): void on(sigName: "action-invoked", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "action-invoked", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "action-invoked", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify-failed", callback: (($obj: ContentDirectory, callbackUrl: Soup.URI[], reason: GLib.Error) => void)): number connect_after(sigName: "notify-failed", callback: (($obj: ContentDirectory, callbackUrl: Soup.URI[], reason: GLib.Error) => void)): number emit(sigName: "notify-failed", callbackUrl: Soup.URI[], reason: GLib.Error): void on(sigName: "notify-failed", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify-failed", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify-failed", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "query-variable", callback: (($obj: ContentDirectory, variable: string, value: any) => void)): number connect_after(sigName: "query-variable", callback: (($obj: ContentDirectory, variable: string, value: any) => void)): number emit(sigName: "query-variable", variable: string, value: any): void on(sigName: "query-variable", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "query-variable", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "query-variable", callback: (...args: any[]) => void): NodeJS.EventEmitter /* Signals of GObject.Object */ connect(sigName: "notify", callback: (($obj: ContentDirectory, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify", callback: (($obj: ContentDirectory, pspec: GObject.ParamSpec) => void)): number emit(sigName: "notify", pspec: GObject.ParamSpec): void on(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: string, callback: any): number connect_after(sigName: string, callback: any): number emit(sigName: string, ...args: any[]): void disconnect(id: number): void on(sigName: string, callback: any): NodeJS.EventEmitter once(sigName: string, callback: any): NodeJS.EventEmitter off(sigName: string, callback: any): NodeJS.EventEmitter static name: string constructor (config?: ContentDirectory_ConstructProps) _init (config?: ContentDirectory_ConstructProps): void static new(): ContentDirectory static $gtype: GObject.Type } export interface HTTPByteSeekRequest_ConstructProps extends HTTPSeekRequest_ConstructProps { startByte?: number endByte?: number rangeLength?: number totalSize?: number } export class HTTPByteSeekRequest { /* Properties of RygelServer.HTTPByteSeekRequest */ startByte: number endByte: number rangeLength: number totalSize: number /* Fields of RygelServer.HTTPByteSeekRequest */ /* Fields of RygelServer.HTTPSeekRequest */ /* Fields of GObject.Object */ gTypeInstance: GObject.TypeInstance /* Methods of RygelServer.HTTPByteSeekRequest */ getStartByte(): number setStartByte(value: number): void getEndByte(): number setEndByte(value: number): void getRangeLength(): number getTotalSize(): number setTotalSize(value: number): void /* Methods of GObject.Object */ bindProperty(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags): GObject.Binding bindPropertyFull(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags, transformTo: GObject.Closure, transformFrom: GObject.Closure): GObject.Binding forceFloating(): void freezeNotify(): void getData(key: string): object | null getProperty(propertyName: string, value: GObject.Value): void getQdata(quark: GLib.Quark): object | null getv(names: string[], values: GObject.Value[]): void isFloating(): boolean notify(propertyName: string): void notifyByPspec(pspec: GObject.ParamSpec): void ref(): GObject.Object refSink(): GObject.Object runDispose(): void setData(key: string, data?: object | null): void setProperty(propertyName: string, value: GObject.Value): void stealData(key: string): object | null stealQdata(quark: GLib.Quark): object | null thawNotify(): void unref(): void watchClosure(closure: GObject.Closure): void /* Virtual methods of GObject.Object */ vfuncConstructed?(): void vfuncDispatchPropertiesChanged?(nPspecs: number, pspecs: GObject.ParamSpec): void vfuncDispose?(): void vfuncFinalize?(): void vfuncGetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void vfuncNotify?(pspec: GObject.ParamSpec): void vfuncSetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void /* Signals of GObject.Object */ connect(sigName: "notify", callback: (($obj: HTTPByteSeekRequest, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify", callback: (($obj: HTTPByteSeekRequest, pspec: GObject.ParamSpec) => void)): number emit(sigName: "notify", pspec: GObject.ParamSpec): void on(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::start-byte", callback: (($obj: HTTPByteSeekRequest, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::start-byte", callback: (($obj: HTTPByteSeekRequest, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::start-byte", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::start-byte", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::start-byte", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::end-byte", callback: (($obj: HTTPByteSeekRequest, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::end-byte", callback: (($obj: HTTPByteSeekRequest, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::end-byte", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::end-byte", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::end-byte", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::range-length", callback: (($obj: HTTPByteSeekRequest, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::range-length", callback: (($obj: HTTPByteSeekRequest, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::range-length", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::range-length", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::range-length", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::total-size", callback: (($obj: HTTPByteSeekRequest, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::total-size", callback: (($obj: HTTPByteSeekRequest, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::total-size", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::total-size", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::total-size", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: string, callback: any): number connect_after(sigName: string, callback: any): number emit(sigName: string, ...args: any[]): void disconnect(id: number): void on(sigName: string, callback: any): NodeJS.EventEmitter once(sigName: string, callback: any): NodeJS.EventEmitter off(sigName: string, callback: any): NodeJS.EventEmitter static name: string constructor (config?: HTTPByteSeekRequest_ConstructProps) _init (config?: HTTPByteSeekRequest_ConstructProps): void static new(msg: Soup.Message, handler: HTTPGetHandler): HTTPByteSeekRequest static supported(message: Soup.Message, handler: HTTPGetHandler): boolean static requested(msg: Soup.Message): boolean static $gtype: GObject.Type } export interface HTTPByteSeekResponse_ConstructProps extends HTTPResponseElement_ConstructProps { startByte?: number endByte?: number rangeLength?: number totalSize?: number } export class HTTPByteSeekResponse { /* Properties of RygelServer.HTTPByteSeekResponse */ startByte: number endByte: number rangeLength: number totalSize: number /* Fields of RygelServer.HTTPByteSeekResponse */ /* Fields of RygelServer.HTTPResponseElement */ /* Fields of GObject.Object */ gTypeInstance: GObject.TypeInstance /* Methods of RygelServer.HTTPByteSeekResponse */ getStartByte(): number setStartByte(value: number): void getEndByte(): number setEndByte(value: number): void getRangeLength(): number getTotalSize(): number setTotalSize(value: number): void /* Methods of RygelServer.HTTPResponseElement */ addResponseHeaders(request: HTTPRequest): void /* Methods of GObject.Object */ bindProperty(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags): GObject.Binding bindPropertyFull(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags, transformTo: GObject.Closure, transformFrom: GObject.Closure): GObject.Binding forceFloating(): void freezeNotify(): void getData(key: string): object | null getProperty(propertyName: string, value: GObject.Value): void getQdata(quark: GLib.Quark): object | null getv(names: string[], values: GObject.Value[]): void isFloating(): boolean notify(propertyName: string): void notifyByPspec(pspec: GObject.ParamSpec): void ref(): GObject.Object refSink(): GObject.Object runDispose(): void setData(key: string, data?: object | null): void setProperty(propertyName: string, value: GObject.Value): void stealData(key: string): object | null stealQdata(quark: GLib.Quark): object | null thawNotify(): void unref(): void watchClosure(closure: GObject.Closure): void /* Virtual methods of RygelServer.HTTPResponseElement */ vfuncAddResponseHeaders?(request: HTTPRequest): void vfuncToString?(): string /* Virtual methods of GObject.Object */ vfuncConstructed?(): void vfuncDispatchPropertiesChanged?(nPspecs: number, pspecs: GObject.ParamSpec): void vfuncDispose?(): void vfuncFinalize?(): void vfuncGetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void vfuncNotify?(pspec: GObject.ParamSpec): void vfuncSetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void /* Signals of GObject.Object */ connect(sigName: "notify", callback: (($obj: HTTPByteSeekResponse, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify", callback: (($obj: HTTPByteSeekResponse, pspec: GObject.ParamSpec) => void)): number emit(sigName: "notify", pspec: GObject.ParamSpec): void on(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::start-byte", callback: (($obj: HTTPByteSeekResponse, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::start-byte", callback: (($obj: HTTPByteSeekResponse, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::start-byte", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::start-byte", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::start-byte", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::end-byte", callback: (($obj: HTTPByteSeekResponse, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::end-byte", callback: (($obj: HTTPByteSeekResponse, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::end-byte", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::end-byte", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::end-byte", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::range-length", callback: (($obj: HTTPByteSeekResponse, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::range-length", callback: (($obj: HTTPByteSeekResponse, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::range-length", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::range-length", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::range-length", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::total-size", callback: (($obj: HTTPByteSeekResponse, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::total-size", callback: (($obj: HTTPByteSeekResponse, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::total-size", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::total-size", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::total-size", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: string, callback: any): number connect_after(sigName: string, callback: any): number emit(sigName: string, ...args: any[]): void disconnect(id: number): void on(sigName: string, callback: any): NodeJS.EventEmitter once(sigName: string, callback: any): NodeJS.EventEmitter off(sigName: string, callback: any): NodeJS.EventEmitter static name: string constructor (config?: HTTPByteSeekResponse_ConstructProps) _init (config?: HTTPByteSeekResponse_ConstructProps): void static new(startByte: number, endByte: number, totalSize: number): HTTPByteSeekResponse static fromRequest(request: HTTPByteSeekRequest): HTTPByteSeekResponse static $gtype: GObject.Type } export interface HTTPGetHandler_ConstructProps extends GObject.Object_ConstructProps { cancellable?: Gio.Cancellable } export class HTTPGetHandler { /* Properties of RygelServer.HTTPGetHandler */ cancellable: Gio.Cancellable /* Fields of RygelServer.HTTPGetHandler */ /* Fields of GObject.Object */ gTypeInstance: GObject.TypeInstance /* Methods of RygelServer.HTTPGetHandler */ addResponseHeaders(request: HTTPGet): void getDefaultTransferMode(): string supportsTransferMode(mode: string): boolean getResourceSize(): number getResourceDuration(): number supportsByteSeek(): boolean supportsTimeSeek(): boolean supportsPlayspeed(): boolean renderBody(request: HTTPGet): HTTPResponse getCancellable(): Gio.Cancellable setCancellable(value: Gio.Cancellable): void /* Methods of GObject.Object */ bindProperty(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags): GObject.Binding bindPropertyFull(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags, transformTo: GObject.Closure, transformFrom: GObject.Closure): GObject.Binding forceFloating(): void freezeNotify(): void getData(key: string): object | null getProperty(propertyName: string, value: GObject.Value): void getQdata(quark: GLib.Quark): object | null getv(names: string[], values: GObject.Value[]): void isFloating(): boolean notify(propertyName: string): void notifyByPspec(pspec: GObject.ParamSpec): void ref(): GObject.Object refSink(): GObject.Object runDispose(): void setData(key: string, data?: object | null): void setProperty(propertyName: string, value: GObject.Value): void stealData(key: string): object | null stealQdata(quark: GLib.Quark): object | null thawNotify(): void unref(): void watchClosure(closure: GObject.Closure): void /* Virtual methods of RygelServer.HTTPGetHandler */ vfuncAddResponseHeaders?(request: HTTPGet): void vfuncGetDefaultTransferMode?(): string vfuncSupportsTransferMode?(mode: string): boolean vfuncGetResourceSize?(): number vfuncGetResourceDuration?(): number vfuncSupportsByteSeek?(): boolean vfuncSupportsTimeSeek?(): boolean vfuncSupportsPlayspeed?(): boolean vfuncRenderBody?(request: HTTPGet): HTTPResponse /* Virtual methods of GObject.Object */ vfuncConstructed?(): void vfuncDispatchPropertiesChanged?(nPspecs: number, pspecs: GObject.ParamSpec): void vfuncDispose?(): void vfuncFinalize?(): void vfuncGetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void vfuncNotify?(pspec: GObject.ParamSpec): void vfuncSetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void /* Signals of GObject.Object */ connect(sigName: "notify", callback: (($obj: HTTPGetHandler, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify", callback: (($obj: HTTPGetHandler, pspec: GObject.ParamSpec) => void)): number emit(sigName: "notify", pspec: GObject.ParamSpec): void on(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::cancellable", callback: (($obj: HTTPGetHandler, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::cancellable", callback: (($obj: HTTPGetHandler, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::cancellable", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::cancellable", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::cancellable", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: string, callback: any): number connect_after(sigName: string, callback: any): number emit(sigName: string, ...args: any[]): void disconnect(id: number): void on(sigName: string, callback: any): NodeJS.EventEmitter once(sigName: string, callback: any): NodeJS.EventEmitter off(sigName: string, callback: any): NodeJS.EventEmitter static name: string constructor (config?: HTTPGetHandler_ConstructProps) _init (config?: HTTPGetHandler_ConstructProps): void static $gtype: GObject.Type } export interface HTTPGet_ConstructProps extends HTTPRequest_ConstructProps { } export class HTTPGet { /* Fields of RygelServer.HTTPGet */ seek: HTTPSeekRequest speedRequest: PlaySpeedRequest handler: HTTPGetHandler /* Fields of RygelServer.HTTPRequest */ httpServer: HTTPServer server: Soup.Server msg: Soup.Message uri: HTTPItemURI object: MediaObject hack: any /* Fields of GObject.Object */ gTypeInstance: GObject.TypeInstance /* Methods of RygelServer.HTTPRequest */ handle(callback?: Gio.AsyncReadyCallback | null): void handleFinish(res: Gio.AsyncResult): void findItem(callback?: Gio.AsyncReadyCallback | null): void findItemFinish(res: Gio.AsyncResult): void handleError(error: GLib.Error): void end(status: number, reason?: string | null): void /* Methods of GObject.Object */ bindProperty(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags): GObject.Binding bindPropertyFull(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags, transformTo: GObject.Closure, transformFrom: GObject.Closure): GObject.Binding forceFloating(): void freezeNotify(): void getData(key: string): object | null getProperty(propertyName: string, value: GObject.Value): void getQdata(quark: GLib.Quark): object | null getv(names: string[], values: GObject.Value[]): void isFloating(): boolean notify(propertyName: string): void notifyByPspec(pspec: GObject.ParamSpec): void ref(): GObject.Object refSink(): GObject.Object runDispose(): void setData(key: string, data?: object | null): void setProperty(propertyName: string, value: GObject.Value): void stealData(key: string): object | null stealQdata(quark: GLib.Quark): object | null thawNotify(): void unref(): void watchClosure(closure: GObject.Closure): void /* Virtual methods of RygelServer.HTTPRequest */ vfuncHandle?(callback?: Gio.AsyncReadyCallback | null): void vfuncHandleFinish?(res: Gio.AsyncResult): void vfuncFindItem?(callback?: Gio.AsyncReadyCallback | null): void vfuncFindItemFinish?(res: Gio.AsyncResult): void /* Virtual methods of GObject.Object */ vfuncConstructed?(): void vfuncDispatchPropertiesChanged?(nPspecs: number, pspecs: GObject.ParamSpec): void vfuncDispose?(): void vfuncFinalize?(): void vfuncGetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void vfuncNotify?(pspec: GObject.ParamSpec): void vfuncSetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void /* Signals of GObject.Object */ connect(sigName: "notify", callback: (($obj: HTTPGet, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify", callback: (($obj: HTTPGet, pspec: GObject.ParamSpec) => void)): number emit(sigName: "notify", pspec: GObject.ParamSpec): void on(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: string, callback: any): number connect_after(sigName: string, callback: any): number emit(sigName: string, ...args: any[]): void disconnect(id: number): void on(sigName: string, callback: any): NodeJS.EventEmitter once(sigName: string, callback: any): NodeJS.EventEmitter off(sigName: string, callback: any): NodeJS.EventEmitter static name: string constructor (config?: HTTPGet_ConstructProps) _init (config?: HTTPGet_ConstructProps): void static new(httpServer: HTTPServer, server: Soup.Server, msg: Soup.Message): HTTPGet static $gtype: GObject.Type } export interface HTTPItemURI_ConstructProps extends GObject.Object_ConstructProps { itemId?: string thumbnailIndex?: number subtitleIndex?: number resourceName?: string httpServer?: HTTPServer extension?: string } export class HTTPItemURI { /* Properties of RygelServer.HTTPItemURI */ itemId: string thumbnailIndex: number subtitleIndex: number resourceName: string httpServer: HTTPServer extension: string /* Fields of RygelServer.HTTPItemURI */ rygelHttpItemUriMimeToExt: Gee.HashMap /* Fields of GObject.Object */ gTypeInstance: GObject.TypeInstance /* Methods of RygelServer.HTTPItemURI */ getItemId(): string setItemId(value: string): void getThumbnailIndex(): number setThumbnailIndex(value: number): void getSubtitleIndex(): number setSubtitleIndex(value: number): void getResourceName(): string | null setResourceName(value?: string | null): void getHttpServer(): HTTPServer setHttpServer(value: HTTPServer): void getExtension(): string setExtension(value: string): void /* Methods of GObject.Object */ bindProperty(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags): GObject.Binding bindPropertyFull(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags, transformTo: GObject.Closure, transformFrom: GObject.Closure): GObject.Binding forceFloating(): void freezeNotify(): void getData(key: string): object | null getProperty(propertyName: string, value: GObject.Value): void getQdata(quark: GLib.Quark): object | null getv(names: string[], values: GObject.Value[]): void isFloating(): boolean notify(propertyName: string): void notifyByPspec(pspec: GObject.ParamSpec): void ref(): GObject.Object refSink(): GObject.Object runDispose(): void setData(key: string, data?: object | null): void setProperty(propertyName: string, value: GObject.Value): void stealData(key: string): object | null stealQdata(quark: GLib.Quark): object | null thawNotify(): void unref(): void watchClosure(closure: GObject.Closure): void /* Virtual methods of GObject.Object */ vfuncConstructed?(): void vfuncDispatchPropertiesChanged?(nPspecs: number, pspecs: GObject.ParamSpec): void vfuncDispose?(): void vfuncFinalize?(): void vfuncGetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void vfuncNotify?(pspec: GObject.ParamSpec): void vfuncSetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void /* Signals of GObject.Object */ connect(sigName: "notify", callback: (($obj: HTTPItemURI, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify", callback: (($obj: HTTPItemURI, pspec: GObject.ParamSpec) => void)): number emit(sigName: "notify", pspec: GObject.ParamSpec): void on(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::item-id", callback: (($obj: HTTPItemURI, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::item-id", callback: (($obj: HTTPItemURI, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::item-id", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::item-id", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::item-id", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::thumbnail-index", callback: (($obj: HTTPItemURI, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::thumbnail-index", callback: (($obj: HTTPItemURI, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::thumbnail-index", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::thumbnail-index", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::thumbnail-index", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::subtitle-index", callback: (($obj: HTTPItemURI, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::subtitle-index", callback: (($obj: HTTPItemURI, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::subtitle-index", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::subtitle-index", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::subtitle-index", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::resource-name", callback: (($obj: HTTPItemURI, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::resource-name", callback: (($obj: HTTPItemURI, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::resource-name", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::resource-name", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::resource-name", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::http-server", callback: (($obj: HTTPItemURI, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::http-server", callback: (($obj: HTTPItemURI, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::http-server", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::http-server", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::http-server", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::extension", callback: (($obj: HTTPItemURI, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::extension", callback: (($obj: HTTPItemURI, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::extension", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::extension", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::extension", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: string, callback: any): number connect_after(sigName: string, callback: any): number emit(sigName: string, ...args: any[]): void disconnect(id: number): void on(sigName: string, callback: any): NodeJS.EventEmitter once(sigName: string, callback: any): NodeJS.EventEmitter off(sigName: string, callback: any): NodeJS.EventEmitter static name: string constructor (config?: HTTPItemURI_ConstructProps) _init (config?: HTTPItemURI_ConstructProps): void static new(object: MediaObject, httpServer: HTTPServer, thumbnailIndex: number, subtitleIndex: number, resourceName?: string | null): HTTPItemURI static fromString(uri: string, httpServer: HTTPServer): HTTPItemURI static $gtype: GObject.Type } export interface HTTPRequest_ConstructProps extends GObject.Object_ConstructProps { } export class HTTPRequest { /* Properties of RygelCore.StateMachine */ cancellable: Gio.Cancellable /* Fields of RygelServer.HTTPRequest */ httpServer: HTTPServer server: Soup.Server msg: Soup.Message uri: HTTPItemURI object: MediaObject hack: any /* Fields of GObject.Object */ gTypeInstance: GObject.TypeInstance /* Methods of RygelServer.HTTPRequest */ handle(callback?: Gio.AsyncReadyCallback | null): void handleFinish(res: Gio.AsyncResult): void findItem(callback?: Gio.AsyncReadyCallback | null): void findItemFinish(res: Gio.AsyncResult): void handleError(error: GLib.Error): void end(status: number, reason?: string | null): void /* Methods of GObject.Object */ bindProperty(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags): GObject.Binding bindPropertyFull(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags, transformTo: GObject.Closure, transformFrom: GObject.Closure): GObject.Binding forceFloating(): void freezeNotify(): void getData(key: string): object | null getProperty(propertyName: string, value: GObject.Value): void getQdata(quark: GLib.Quark): object | null getv(names: string[], values: GObject.Value[]): void isFloating(): boolean notify(propertyName: string): void notifyByPspec(pspec: GObject.ParamSpec): void ref(): GObject.Object refSink(): GObject.Object runDispose(): void setData(key: string, data?: object | null): void setProperty(propertyName: string, value: GObject.Value): void stealData(key: string): object | null stealQdata(quark: GLib.Quark): object | null thawNotify(): void unref(): void watchClosure(closure: GObject.Closure): void /* Methods of RygelCore.StateMachine */ run(callback?: Gio.AsyncReadyCallback | null): void runFinish(res: Gio.AsyncResult): void getCancellable(): Gio.Cancellable setCancellable(value: Gio.Cancellable): void /* Virtual methods of RygelServer.HTTPRequest */ vfuncHandle?(callback?: Gio.AsyncReadyCallback | null): void vfuncHandleFinish?(res: Gio.AsyncResult): void vfuncFindItem?(callback?: Gio.AsyncReadyCallback | null): void vfuncFindItemFinish?(res: Gio.AsyncResult): void /* Virtual methods of GObject.Object */ vfuncConstructed?(): void vfuncDispatchPropertiesChanged?(nPspecs: number, pspecs: GObject.ParamSpec): void vfuncDispose?(): void vfuncFinalize?(): void vfuncGetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void vfuncNotify?(pspec: GObject.ParamSpec): void vfuncSetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void /* Signals of GObject.Object */ connect(sigName: "notify", callback: (($obj: HTTPRequest, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify", callback: (($obj: HTTPRequest, pspec: GObject.ParamSpec) => void)): number emit(sigName: "notify", pspec: GObject.ParamSpec): void on(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter /* Signals of RygelCore.StateMachine */ connect(sigName: "completed", callback: (($obj: HTTPRequest) => void)): number connect_after(sigName: "completed", callback: (($obj: HTTPRequest) => void)): number emit(sigName: "completed"): void on(sigName: "completed", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "completed", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "completed", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::cancellable", callback: (($obj: HTTPRequest, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::cancellable", callback: (($obj: HTTPRequest, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::cancellable", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::cancellable", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::cancellable", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: string, callback: any): number connect_after(sigName: string, callback: any): number emit(sigName: string, ...args: any[]): void disconnect(id: number): void on(sigName: string, callback: any): NodeJS.EventEmitter once(sigName: string, callback: any): NodeJS.EventEmitter off(sigName: string, callback: any): NodeJS.EventEmitter static name: string constructor (config?: HTTPRequest_ConstructProps) _init (config?: HTTPRequest_ConstructProps): void static $gtype: GObject.Type } export interface HTTPResponse_ConstructProps extends GObject.Object_ConstructProps { server?: Soup.Server } export class HTTPResponse { /* Properties of RygelServer.HTTPResponse */ server: Soup.Server readonly priority: number /* Properties of RygelCore.StateMachine */ cancellable: Gio.Cancellable /* Fields of RygelServer.HTTPResponse */ msg: Soup.Message seek: HTTPSeekRequest speed: PlaySpeedRequest /* Fields of GObject.Object */ gTypeInstance: GObject.TypeInstance /* Methods of RygelServer.HTTPResponse */ preroll(): Gee.List | null end(aborted: boolean, status: number): void getServer(): Soup.Server getPriority(): number /* Methods of GObject.Object */ bindProperty(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags): GObject.Binding bindPropertyFull(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags, transformTo: GObject.Closure, transformFrom: GObject.Closure): GObject.Binding forceFloating(): void freezeNotify(): void getData(key: string): object | null getProperty(propertyName: string, value: GObject.Value): void getQdata(quark: GLib.Quark): object | null getv(names: string[], values: GObject.Value[]): void isFloating(): boolean notify(propertyName: string): void notifyByPspec(pspec: GObject.ParamSpec): void ref(): GObject.Object refSink(): GObject.Object runDispose(): void setData(key: string, data?: object | null): void setProperty(propertyName: string, value: GObject.Value): void stealData(key: string): object | null stealQdata(quark: GLib.Quark): object | null thawNotify(): void unref(): void watchClosure(closure: GObject.Closure): void /* Methods of RygelCore.StateMachine */ run(callback?: Gio.AsyncReadyCallback | null): void runFinish(res: Gio.AsyncResult): void getCancellable(): Gio.Cancellable setCancellable(value: Gio.Cancellable): void /* Virtual methods of RygelServer.HTTPResponse */ vfuncEnd?(aborted: boolean, status: number): void /* Virtual methods of GObject.Object */ vfuncConstructed?(): void vfuncDispatchPropertiesChanged?(nPspecs: number, pspecs: GObject.ParamSpec): void vfuncDispose?(): void vfuncFinalize?(): void vfuncGetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void vfuncNotify?(pspec: GObject.ParamSpec): void vfuncSetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void /* Signals of GObject.Object */ connect(sigName: "notify", callback: (($obj: HTTPResponse, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify", callback: (($obj: HTTPResponse, pspec: GObject.ParamSpec) => void)): number emit(sigName: "notify", pspec: GObject.ParamSpec): void on(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter /* Signals of RygelCore.StateMachine */ connect(sigName: "completed", callback: (($obj: HTTPResponse) => void)): number connect_after(sigName: "completed", callback: (($obj: HTTPResponse) => void)): number emit(sigName: "completed"): void on(sigName: "completed", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "completed", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "completed", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::server", callback: (($obj: HTTPResponse, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::server", callback: (($obj: HTTPResponse, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::server", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::server", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::server", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::priority", callback: (($obj: HTTPResponse, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::priority", callback: (($obj: HTTPResponse, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::priority", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::priority", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::priority", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::cancellable", callback: (($obj: HTTPResponse, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::cancellable", callback: (($obj: HTTPResponse, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::cancellable", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::cancellable", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::cancellable", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: string, callback: any): number connect_after(sigName: string, callback: any): number emit(sigName: string, ...args: any[]): void disconnect(id: number): void on(sigName: string, callback: any): NodeJS.EventEmitter once(sigName: string, callback: any): NodeJS.EventEmitter off(sigName: string, callback: any): NodeJS.EventEmitter static name: string constructor (config?: HTTPResponse_ConstructProps) _init (config?: HTTPResponse_ConstructProps): void static new(request: HTTPGet, requestHandler: HTTPGetHandler, src: DataSource): HTTPResponse static $gtype: GObject.Type } export interface HTTPResponseElement_ConstructProps extends GObject.Object_ConstructProps { } export class HTTPResponseElement { /* Fields of RygelServer.HTTPResponseElement */ /* Fields of GObject.Object */ gTypeInstance: GObject.TypeInstance /* Methods of RygelServer.HTTPResponseElement */ addResponseHeaders(request: HTTPRequest): void /* Methods of GObject.Object */ bindProperty(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags): GObject.Binding bindPropertyFull(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags, transformTo: GObject.Closure, transformFrom: GObject.Closure): GObject.Binding forceFloating(): void freezeNotify(): void getData(key: string): object | null getProperty(propertyName: string, value: GObject.Value): void getQdata(quark: GLib.Quark): object | null getv(names: string[], values: GObject.Value[]): void isFloating(): boolean notify(propertyName: string): void notifyByPspec(pspec: GObject.ParamSpec): void ref(): GObject.Object refSink(): GObject.Object runDispose(): void setData(key: string, data?: object | null): void setProperty(propertyName: string, value: GObject.Value): void stealData(key: string): object | null stealQdata(quark: GLib.Quark): object | null thawNotify(): void unref(): void watchClosure(closure: GObject.Closure): void /* Virtual methods of RygelServer.HTTPResponseElement */ vfuncAddResponseHeaders?(request: HTTPRequest): void vfuncToString?(): string /* Virtual methods of GObject.Object */ vfuncConstructed?(): void vfuncDispatchPropertiesChanged?(nPspecs: number, pspecs: GObject.ParamSpec): void vfuncDispose?(): void vfuncFinalize?(): void vfuncGetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void vfuncNotify?(pspec: GObject.ParamSpec): void vfuncSetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void /* Signals of GObject.Object */ connect(sigName: "notify", callback: (($obj: HTTPResponseElement, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify", callback: (($obj: HTTPResponseElement, pspec: GObject.ParamSpec) => void)): number emit(sigName: "notify", pspec: GObject.ParamSpec): void on(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: string, callback: any): number connect_after(sigName: string, callback: any): number emit(sigName: string, ...args: any[]): void disconnect(id: number): void on(sigName: string, callback: any): NodeJS.EventEmitter once(sigName: string, callback: any): NodeJS.EventEmitter off(sigName: string, callback: any): NodeJS.EventEmitter static name: string constructor (config?: HTTPResponseElement_ConstructProps) _init (config?: HTTPResponseElement_ConstructProps): void static $gtype: GObject.Type } export interface HTTPServer_ConstructProps extends GObject.Object_ConstructProps { pathRoot?: string serverName?: string } export class HTTPServer { /* Properties of RygelServer.HTTPServer */ pathRoot: string serverName: string /* Properties of RygelCore.StateMachine */ cancellable: Gio.Cancellable /* Fields of RygelServer.HTTPServer */ rootContainer: MediaContainer context: GUPnP.Context replacements: GLib.HashTable /* Fields of GObject.Object */ gTypeInstance: GObject.TypeInstance /* Methods of RygelServer.HTTPServer */ setResourceDeliveryOptions(res: MediaResource): void needProxy(uri: string): boolean getProtocol(): string getProtocolInfo(): Gee.ArrayList getReplacements(): GLib.HashTable isLocal(): boolean getPathRoot(): string getServerName(): string setServerName(value: string): void /* Methods of GObject.Object */ bindProperty(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags): GObject.Binding bindPropertyFull(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags, transformTo: GObject.Closure, transformFrom: GObject.Closure): GObject.Binding forceFloating(): void freezeNotify(): void getData(key: string): object | null getProperty(propertyName: string, value: GObject.Value): void getQdata(quark: GLib.Quark): object | null getv(names: string[], values: GObject.Value[]): void isFloating(): boolean notify(propertyName: string): void notifyByPspec(pspec: GObject.ParamSpec): void ref(): GObject.Object refSink(): GObject.Object runDispose(): void setData(key: string, data?: object | null): void setProperty(propertyName: string, value: GObject.Value): void stealData(key: string): object | null stealQdata(quark: GLib.Quark): object | null thawNotify(): void unref(): void watchClosure(closure: GObject.Closure): void /* Methods of RygelCore.StateMachine */ run(callback?: Gio.AsyncReadyCallback | null): void runFinish(res: Gio.AsyncResult): void getCancellable(): Gio.Cancellable setCancellable(value: Gio.Cancellable): void /* Virtual methods of RygelServer.HTTPServer */ vfuncGetProtocol?(): string vfuncGetProtocolInfo?(): Gee.ArrayList /* Virtual methods of GObject.Object */ vfuncConstructed?(): void vfuncDispatchPropertiesChanged?(nPspecs: number, pspecs: GObject.ParamSpec): void vfuncDispose?(): void vfuncFinalize?(): void vfuncGetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void vfuncNotify?(pspec: GObject.ParamSpec): void vfuncSetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void /* Signals of GObject.Object */ connect(sigName: "notify", callback: (($obj: HTTPServer, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify", callback: (($obj: HTTPServer, pspec: GObject.ParamSpec) => void)): number emit(sigName: "notify", pspec: GObject.ParamSpec): void on(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter /* Signals of RygelCore.StateMachine */ connect(sigName: "completed", callback: (($obj: HTTPServer) => void)): number connect_after(sigName: "completed", callback: (($obj: HTTPServer) => void)): number emit(sigName: "completed"): void on(sigName: "completed", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "completed", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "completed", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::path-root", callback: (($obj: HTTPServer, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::path-root", callback: (($obj: HTTPServer, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::path-root", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::path-root", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::path-root", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::server-name", callback: (($obj: HTTPServer, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::server-name", callback: (($obj: HTTPServer, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::server-name", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::server-name", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::server-name", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::cancellable", callback: (($obj: HTTPServer, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::cancellable", callback: (($obj: HTTPServer, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::cancellable", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::cancellable", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::cancellable", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: string, callback: any): number connect_after(sigName: string, callback: any): number emit(sigName: string, ...args: any[]): void disconnect(id: number): void on(sigName: string, callback: any): NodeJS.EventEmitter once(sigName: string, callback: any): NodeJS.EventEmitter off(sigName: string, callback: any): NodeJS.EventEmitter static name: string constructor (config?: HTTPServer_ConstructProps) _init (config?: HTTPServer_ConstructProps): void static new(contentDir: ContentDirectory, name: string): HTTPServer static $gtype: GObject.Type } export interface HTTPTimeSeekRequest_ConstructProps extends HTTPSeekRequest_ConstructProps { } export class HTTPTimeSeekRequest { /* Fields of RygelServer.HTTPTimeSeekRequest */ startTime: number endTime: number rangeDuration: number totalDuration: number /* Fields of RygelServer.HTTPSeekRequest */ /* Fields of GObject.Object */ gTypeInstance: GObject.TypeInstance /* Methods of RygelServer.HTTPTimeSeekRequest */ /* Methods of GObject.Object */ bindProperty(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags): GObject.Binding bindPropertyFull(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags, transformTo: GObject.Closure, transformFrom: GObject.Closure): GObject.Binding forceFloating(): void freezeNotify(): void getData(key: string): object | null getProperty(propertyName: string, value: GObject.Value): void getQdata(quark: GLib.Quark): object | null getv(names: string[], values: GObject.Value[]): void isFloating(): boolean notify(propertyName: string): void notifyByPspec(pspec: GObject.ParamSpec): void ref(): GObject.Object refSink(): GObject.Object runDispose(): void setData(key: string, data?: object | null): void setProperty(propertyName: string, value: GObject.Value): void stealData(key: string): object | null stealQdata(quark: GLib.Quark): object | null thawNotify(): void unref(): void watchClosure(closure: GObject.Closure): void /* Virtual methods of GObject.Object */ vfuncConstructed?(): void vfuncDispatchPropertiesChanged?(nPspecs: number, pspecs: GObject.ParamSpec): void vfuncDispose?(): void vfuncFinalize?(): void vfuncGetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void vfuncNotify?(pspec: GObject.ParamSpec): void vfuncSetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void /* Signals of GObject.Object */ connect(sigName: "notify", callback: (($obj: HTTPTimeSeekRequest, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify", callback: (($obj: HTTPTimeSeekRequest, pspec: GObject.ParamSpec) => void)): number emit(sigName: "notify", pspec: GObject.ParamSpec): void on(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: string, callback: any): number connect_after(sigName: string, callback: any): number emit(sigName: string, ...args: any[]): void disconnect(id: number): void on(sigName: string, callback: any): NodeJS.EventEmitter once(sigName: string, callback: any): NodeJS.EventEmitter off(sigName: string, callback: any): NodeJS.EventEmitter static name: string constructor (config?: HTTPTimeSeekRequest_ConstructProps) _init (config?: HTTPTimeSeekRequest_ConstructProps): void static supported(message: Soup.Message, handler: HTTPGetHandler): boolean static requested(message: Soup.Message): boolean static $gtype: GObject.Type } export interface HTTPTimeSeekResponse_ConstructProps extends HTTPResponseElement_ConstructProps { startTime?: number endTime?: number rangeDuration?: number totalDuration?: number startByte?: number endByte?: number responseLength?: number totalSize?: number } export class HTTPTimeSeekResponse { /* Properties of RygelServer.HTTPTimeSeekResponse */ startTime: number endTime: number rangeDuration: number totalDuration: number startByte: number endByte: number responseLength: number totalSize: number /* Fields of RygelServer.HTTPTimeSeekResponse */ /* Fields of RygelServer.HTTPResponseElement */ /* Fields of GObject.Object */ gTypeInstance: GObject.TypeInstance /* Methods of RygelServer.HTTPTimeSeekResponse */ getStartTime(): number getEndTime(): number getRangeDuration(): number getTotalDuration(): number getStartByte(): number getEndByte(): number getResponseLength(): number getTotalSize(): number /* Methods of RygelServer.HTTPResponseElement */ addResponseHeaders(request: HTTPRequest): void /* Methods of GObject.Object */ bindProperty(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags): GObject.Binding bindPropertyFull(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags, transformTo: GObject.Closure, transformFrom: GObject.Closure): GObject.Binding forceFloating(): void freezeNotify(): void getData(key: string): object | null getProperty(propertyName: string, value: GObject.Value): void getQdata(quark: GLib.Quark): object | null getv(names: string[], values: GObject.Value[]): void isFloating(): boolean notify(propertyName: string): void notifyByPspec(pspec: GObject.ParamSpec): void ref(): GObject.Object refSink(): GObject.Object runDispose(): void setData(key: string, data?: object | null): void setProperty(propertyName: string, value: GObject.Value): void stealData(key: string): object | null stealQdata(quark: GLib.Quark): object | null thawNotify(): void unref(): void watchClosure(closure: GObject.Closure): void /* Virtual methods of RygelServer.HTTPResponseElement */ vfuncAddResponseHeaders?(request: HTTPRequest): void vfuncToString?(): string /* Virtual methods of GObject.Object */ vfuncConstructed?(): void vfuncDispatchPropertiesChanged?(nPspecs: number, pspecs: GObject.ParamSpec): void vfuncDispose?(): void vfuncFinalize?(): void vfuncGetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void vfuncNotify?(pspec: GObject.ParamSpec): void vfuncSetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void /* Signals of GObject.Object */ connect(sigName: "notify", callback: (($obj: HTTPTimeSeekResponse, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify", callback: (($obj: HTTPTimeSeekResponse, pspec: GObject.ParamSpec) => void)): number emit(sigName: "notify", pspec: GObject.ParamSpec): void on(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::start-time", callback: (($obj: HTTPTimeSeekResponse, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::start-time", callback: (($obj: HTTPTimeSeekResponse, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::start-time", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::start-time", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::start-time", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::end-time", callback: (($obj: HTTPTimeSeekResponse, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::end-time", callback: (($obj: HTTPTimeSeekResponse, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::end-time", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::end-time", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::end-time", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::range-duration", callback: (($obj: HTTPTimeSeekResponse, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::range-duration", callback: (($obj: HTTPTimeSeekResponse, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::range-duration", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::range-duration", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::range-duration", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::total-duration", callback: (($obj: HTTPTimeSeekResponse, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::total-duration", callback: (($obj: HTTPTimeSeekResponse, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::total-duration", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::total-duration", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::total-duration", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::start-byte", callback: (($obj: HTTPTimeSeekResponse, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::start-byte", callback: (($obj: HTTPTimeSeekResponse, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::start-byte", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::start-byte", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::start-byte", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::end-byte", callback: (($obj: HTTPTimeSeekResponse, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::end-byte", callback: (($obj: HTTPTimeSeekResponse, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::end-byte", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::end-byte", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::end-byte", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::response-length", callback: (($obj: HTTPTimeSeekResponse, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::response-length", callback: (($obj: HTTPTimeSeekResponse, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::response-length", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::response-length", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::response-length", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::total-size", callback: (($obj: HTTPTimeSeekResponse, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::total-size", callback: (($obj: HTTPTimeSeekResponse, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::total-size", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::total-size", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::total-size", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: string, callback: any): number connect_after(sigName: string, callback: any): number emit(sigName: string, ...args: any[]): void disconnect(id: number): void on(sigName: string, callback: any): NodeJS.EventEmitter once(sigName: string, callback: any): NodeJS.EventEmitter off(sigName: string, callback: any): NodeJS.EventEmitter static name: string constructor (config?: HTTPTimeSeekResponse_ConstructProps) _init (config?: HTTPTimeSeekResponse_ConstructProps): void static new(startTime: number, endTime: number, totalDuration: number, startByte: number, endByte: number, totalSize: number): HTTPTimeSeekResponse static timeOnly(startTime: number, endTime: number, totalDuration: number): HTTPTimeSeekResponse static withLength(startTime: number, endTime: number, totalDuration: number, startByte: number, endByte: number, totalSize: number, responseLength: number): HTTPTimeSeekResponse static fromRequest(timeSeekRequest: HTTPTimeSeekRequest, totalDuration: number): HTTPTimeSeekResponse static $gtype: GObject.Type } export interface Serializer_ConstructProps extends GObject.Object_ConstructProps { serializerType?: SerializerType } export class Serializer { /* Properties of RygelServer.Serializer */ /* Fields of RygelServer.Serializer */ /* Fields of GObject.Object */ gTypeInstance: GObject.TypeInstance /* Methods of RygelServer.Serializer */ addItem(): GUPnPAV.DIDLLiteItem | null addContainer(): GUPnPAV.DIDLLiteContainer | null filter(filterString: string): void getString(): string /* Methods of GObject.Object */ bindProperty(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags): GObject.Binding bindPropertyFull(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags, transformTo: GObject.Closure, transformFrom: GObject.Closure): GObject.Binding forceFloating(): void freezeNotify(): void getData(key: string): object | null getProperty(propertyName: string, value: GObject.Value): void getQdata(quark: GLib.Quark): object | null getv(names: string[], values: GObject.Value[]): void isFloating(): boolean notify(propertyName: string): void notifyByPspec(pspec: GObject.ParamSpec): void ref(): GObject.Object refSink(): GObject.Object runDispose(): void setData(key: string, data?: object | null): void setProperty(propertyName: string, value: GObject.Value): void stealData(key: string): object | null stealQdata(quark: GLib.Quark): object | null thawNotify(): void unref(): void watchClosure(closure: GObject.Closure): void /* Virtual methods of GObject.Object */ vfuncConstructed?(): void vfuncDispatchPropertiesChanged?(nPspecs: number, pspecs: GObject.ParamSpec): void vfuncDispose?(): void vfuncFinalize?(): void vfuncGetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void vfuncNotify?(pspec: GObject.ParamSpec): void vfuncSetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void /* Signals of GObject.Object */ connect(sigName: "notify", callback: (($obj: Serializer, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify", callback: (($obj: Serializer, pspec: GObject.ParamSpec) => void)): number emit(sigName: "notify", pspec: GObject.ParamSpec): void on(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: string, callback: any): number connect_after(sigName: string, callback: any): number emit(sigName: string, ...args: any[]): void disconnect(id: number): void on(sigName: string, callback: any): NodeJS.EventEmitter once(sigName: string, callback: any): NodeJS.EventEmitter off(sigName: string, callback: any): NodeJS.EventEmitter static name: string constructor (config?: Serializer_ConstructProps) _init (config?: Serializer_ConstructProps): void static new(type: SerializerType): Serializer static $gtype: GObject.Type } export class PlaySpeed { /* Fields of RygelServer.PlaySpeed */ refCount: number numerator: number denominator: number /* Methods of RygelServer.PlaySpeed */ equals(that: PlaySpeed): boolean isPositive(): boolean isNormalRate(): boolean toFloat(): number toDouble(): number static name: string static new(numerator: number, denominator: number): PlaySpeed constructor(numerator: number, denominator: number) static new(numerator: number, denominator: number): PlaySpeed static fromString(speed: string): PlaySpeed } export interface PlaySpeedRequest_ConstructProps extends GObject.Object_ConstructProps { speed?: PlaySpeed } export class PlaySpeedRequest { /* Properties of RygelServer.PlaySpeedRequest */ speed: PlaySpeed /* Fields of RygelServer.PlaySpeedRequest */ /* Fields of GObject.Object */ gTypeInstance: GObject.TypeInstance /* Methods of RygelServer.PlaySpeedRequest */ equals(that: PlaySpeedRequest): boolean getSpeed(): PlaySpeed /* Methods of GObject.Object */ bindProperty(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags): GObject.Binding bindPropertyFull(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags, transformTo: GObject.Closure, transformFrom: GObject.Closure): GObject.Binding forceFloating(): void freezeNotify(): void getData(key: string): object | null getProperty(propertyName: string, value: GObject.Value): void getQdata(quark: GLib.Quark): object | null getv(names: string[], values: GObject.Value[]): void isFloating(): boolean notify(propertyName: string): void notifyByPspec(pspec: GObject.ParamSpec): void ref(): GObject.Object refSink(): GObject.Object runDispose(): void setData(key: string, data?: object | null): void setProperty(propertyName: string, value: GObject.Value): void stealData(key: string): object | null stealQdata(quark: GLib.Quark): object | null thawNotify(): void unref(): void watchClosure(closure: GObject.Closure): void /* Virtual methods of GObject.Object */ vfuncConstructed?(): void vfuncDispatchPropertiesChanged?(nPspecs: number, pspecs: GObject.ParamSpec): void vfuncDispose?(): void vfuncFinalize?(): void vfuncGetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void vfuncNotify?(pspec: GObject.ParamSpec): void vfuncSetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void /* Signals of GObject.Object */ connect(sigName: "notify", callback: (($obj: PlaySpeedRequest, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify", callback: (($obj: PlaySpeedRequest, pspec: GObject.ParamSpec) => void)): number emit(sigName: "notify", pspec: GObject.ParamSpec): void on(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::speed", callback: (($obj: PlaySpeedRequest, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::speed", callback: (($obj: PlaySpeedRequest, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::speed", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::speed", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::speed", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: string, callback: any): number connect_after(sigName: string, callback: any): number emit(sigName: string, ...args: any[]): void disconnect(id: number): void on(sigName: string, callback: any): NodeJS.EventEmitter once(sigName: string, callback: any): NodeJS.EventEmitter off(sigName: string, callback: any): NodeJS.EventEmitter static name: string constructor (config?: PlaySpeedRequest_ConstructProps) _init (config?: PlaySpeedRequest_ConstructProps): void static new(numerator: number, denominator: number): PlaySpeedRequest static fromString(speed: string): PlaySpeedRequest static supported(request: HTTPGet): boolean static $gtype: GObject.Type } export interface PlaySpeedResponse_ConstructProps extends HTTPResponseElement_ConstructProps { } export class PlaySpeedResponse { /* Fields of RygelServer.PlaySpeedResponse */ framerate: number /* Fields of RygelServer.HTTPResponseElement */ /* Fields of GObject.Object */ gTypeInstance: GObject.TypeInstance /* Methods of RygelServer.PlaySpeedResponse */ equals(that: PlaySpeedRequest): boolean /* Methods of RygelServer.HTTPResponseElement */ addResponseHeaders(request: HTTPRequest): void /* Methods of GObject.Object */ bindProperty(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags): GObject.Binding bindPropertyFull(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags, transformTo: GObject.Closure, transformFrom: GObject.Closure): GObject.Binding forceFloating(): void freezeNotify(): void getData(key: string): object | null getProperty(propertyName: string, value: GObject.Value): void getQdata(quark: GLib.Quark): object | null getv(names: string[], values: GObject.Value[]): void isFloating(): boolean notify(propertyName: string): void notifyByPspec(pspec: GObject.ParamSpec): void ref(): GObject.Object refSink(): GObject.Object runDispose(): void setData(key: string, data?: object | null): void setProperty(propertyName: string, value: GObject.Value): void stealData(key: string): object | null stealQdata(quark: GLib.Quark): object | null thawNotify(): void unref(): void watchClosure(closure: GObject.Closure): void /* Virtual methods of RygelServer.HTTPResponseElement */ vfuncAddResponseHeaders?(request: HTTPRequest): void vfuncToString?(): string /* Virtual methods of GObject.Object */ vfuncConstructed?(): void vfuncDispatchPropertiesChanged?(nPspecs: number, pspecs: GObject.ParamSpec): void vfuncDispose?(): void vfuncFinalize?(): void vfuncGetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void vfuncNotify?(pspec: GObject.ParamSpec): void vfuncSetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void /* Signals of GObject.Object */ connect(sigName: "notify", callback: (($obj: PlaySpeedResponse, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify", callback: (($obj: PlaySpeedResponse, pspec: GObject.ParamSpec) => void)): number emit(sigName: "notify", pspec: GObject.ParamSpec): void on(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: string, callback: any): number connect_after(sigName: string, callback: any): number emit(sigName: string, ...args: any[]): void disconnect(id: number): void on(sigName: string, callback: any): NodeJS.EventEmitter once(sigName: string, callback: any): NodeJS.EventEmitter off(sigName: string, callback: any): NodeJS.EventEmitter static name: string constructor (config?: PlaySpeedResponse_ConstructProps) _init (config?: PlaySpeedResponse_ConstructProps): void static new(numerator: number, denominator: number, framerate: number): PlaySpeedResponse static fromSpeed(speed: PlaySpeed, framerate: number): PlaySpeedResponse static fromString(speed: string, framerate: number): PlaySpeedResponse static $gtype: GObject.Type } export interface DTCPCleartextRequest_ConstructProps extends HTTPSeekRequest_ConstructProps { startByte?: number endByte?: number rangeLength?: number totalSize?: number } export class DTCPCleartextRequest { /* Properties of RygelServer.DTCPCleartextRequest */ startByte: number endByte: number rangeLength: number totalSize: number /* Fields of RygelServer.DTCPCleartextRequest */ /* Fields of RygelServer.HTTPSeekRequest */ /* Fields of GObject.Object */ gTypeInstance: GObject.TypeInstance /* Methods of RygelServer.DTCPCleartextRequest */ getStartByte(): number getEndByte(): number getRangeLength(): number getTotalSize(): number /* Methods of GObject.Object */ bindProperty(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags): GObject.Binding bindPropertyFull(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags, transformTo: GObject.Closure, transformFrom: GObject.Closure): GObject.Binding forceFloating(): void freezeNotify(): void getData(key: string): object | null getProperty(propertyName: string, value: GObject.Value): void getQdata(quark: GLib.Quark): object | null getv(names: string[], values: GObject.Value[]): void isFloating(): boolean notify(propertyName: string): void notifyByPspec(pspec: GObject.ParamSpec): void ref(): GObject.Object refSink(): GObject.Object runDispose(): void setData(key: string, data?: object | null): void setProperty(propertyName: string, value: GObject.Value): void stealData(key: string): object | null stealQdata(quark: GLib.Quark): object | null thawNotify(): void unref(): void watchClosure(closure: GObject.Closure): void /* Virtual methods of GObject.Object */ vfuncConstructed?(): void vfuncDispatchPropertiesChanged?(nPspecs: number, pspecs: GObject.ParamSpec): void vfuncDispose?(): void vfuncFinalize?(): void vfuncGetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void vfuncNotify?(pspec: GObject.ParamSpec): void vfuncSetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void /* Signals of GObject.Object */ connect(sigName: "notify", callback: (($obj: DTCPCleartextRequest, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify", callback: (($obj: DTCPCleartextRequest, pspec: GObject.ParamSpec) => void)): number emit(sigName: "notify", pspec: GObject.ParamSpec): void on(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::start-byte", callback: (($obj: DTCPCleartextRequest, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::start-byte", callback: (($obj: DTCPCleartextRequest, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::start-byte", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::start-byte", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::start-byte", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::end-byte", callback: (($obj: DTCPCleartextRequest, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::end-byte", callback: (($obj: DTCPCleartextRequest, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::end-byte", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::end-byte", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::end-byte", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::range-length", callback: (($obj: DTCPCleartextRequest, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::range-length", callback: (($obj: DTCPCleartextRequest, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::range-length", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::range-length", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::range-length", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::total-size", callback: (($obj: DTCPCleartextRequest, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::total-size", callback: (($obj: DTCPCleartextRequest, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::total-size", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::total-size", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::total-size", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: string, callback: any): number connect_after(sigName: string, callback: any): number emit(sigName: string, ...args: any[]): void disconnect(id: number): void on(sigName: string, callback: any): NodeJS.EventEmitter once(sigName: string, callback: any): NodeJS.EventEmitter off(sigName: string, callback: any): NodeJS.EventEmitter static name: string constructor (config?: DTCPCleartextRequest_ConstructProps) _init (config?: DTCPCleartextRequest_ConstructProps): void static new(message: Soup.Message, handler: HTTPGetHandler): DTCPCleartextRequest static supported(message: Soup.Message, handler: HTTPGetHandler): boolean static requested(message: Soup.Message): boolean static $gtype: GObject.Type } export interface DTCPCleartextResponse_ConstructProps extends HTTPResponseElement_ConstructProps { startByte?: number endByte?: number rangeLength?: number totalSize?: number encryptedLength?: number } export class DTCPCleartextResponse { /* Properties of RygelServer.DTCPCleartextResponse */ startByte: number endByte: number rangeLength: number totalSize: number encryptedLength: number /* Fields of RygelServer.DTCPCleartextResponse */ /* Fields of RygelServer.HTTPResponseElement */ /* Fields of GObject.Object */ gTypeInstance: GObject.TypeInstance /* Methods of RygelServer.DTCPCleartextResponse */ getStartByte(): number getEndByte(): number getRangeLength(): number getTotalSize(): number getEncryptedLength(): number setEncryptedLength(value: number): void /* Methods of RygelServer.HTTPResponseElement */ addResponseHeaders(request: HTTPRequest): void /* Methods of GObject.Object */ bindProperty(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags): GObject.Binding bindPropertyFull(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags, transformTo: GObject.Closure, transformFrom: GObject.Closure): GObject.Binding forceFloating(): void freezeNotify(): void getData(key: string): object | null getProperty(propertyName: string, value: GObject.Value): void getQdata(quark: GLib.Quark): object | null getv(names: string[], values: GObject.Value[]): void isFloating(): boolean notify(propertyName: string): void notifyByPspec(pspec: GObject.ParamSpec): void ref(): GObject.Object refSink(): GObject.Object runDispose(): void setData(key: string, data?: object | null): void setProperty(propertyName: string, value: GObject.Value): void stealData(key: string): object | null stealQdata(quark: GLib.Quark): object | null thawNotify(): void unref(): void watchClosure(closure: GObject.Closure): void /* Virtual methods of RygelServer.HTTPResponseElement */ vfuncAddResponseHeaders?(request: HTTPRequest): void vfuncToString?(): string /* Virtual methods of GObject.Object */ vfuncConstructed?(): void vfuncDispatchPropertiesChanged?(nPspecs: number, pspecs: GObject.ParamSpec): void vfuncDispose?(): void vfuncFinalize?(): void vfuncGetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void vfuncNotify?(pspec: GObject.ParamSpec): void vfuncSetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void /* Signals of GObject.Object */ connect(sigName: "notify", callback: (($obj: DTCPCleartextResponse, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify", callback: (($obj: DTCPCleartextResponse, pspec: GObject.ParamSpec) => void)): number emit(sigName: "notify", pspec: GObject.ParamSpec): void on(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::start-byte", callback: (($obj: DTCPCleartextResponse, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::start-byte", callback: (($obj: DTCPCleartextResponse, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::start-byte", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::start-byte", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::start-byte", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::end-byte", callback: (($obj: DTCPCleartextResponse, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::end-byte", callback: (($obj: DTCPCleartextResponse, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::end-byte", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::end-byte", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::end-byte", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::range-length", callback: (($obj: DTCPCleartextResponse, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::range-length", callback: (($obj: DTCPCleartextResponse, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::range-length", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::range-length", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::range-length", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::total-size", callback: (($obj: DTCPCleartextResponse, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::total-size", callback: (($obj: DTCPCleartextResponse, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::total-size", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::total-size", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::total-size", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::encrypted-length", callback: (($obj: DTCPCleartextResponse, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::encrypted-length", callback: (($obj: DTCPCleartextResponse, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::encrypted-length", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::encrypted-length", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::encrypted-length", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: string, callback: any): number connect_after(sigName: string, callback: any): number emit(sigName: string, ...args: any[]): void disconnect(id: number): void on(sigName: string, callback: any): NodeJS.EventEmitter once(sigName: string, callback: any): NodeJS.EventEmitter off(sigName: string, callback: any): NodeJS.EventEmitter static name: string constructor (config?: DTCPCleartextResponse_ConstructProps) _init (config?: DTCPCleartextResponse_ConstructProps): void static new(startByte: number, endByte: number, totalSize: number, encryptedLength: number): DTCPCleartextResponse static fromRequest(request: DTCPCleartextRequest, encryptedLength: number): DTCPCleartextResponse static $gtype: GObject.Type } export interface DLNAAvailableSeekRangeRequest_ConstructProps extends HTTPSeekRequest_ConstructProps { } export class DLNAAvailableSeekRangeRequest { /* Fields of RygelServer.DLNAAvailableSeekRangeRequest */ /* Fields of RygelServer.HTTPSeekRequest */ /* Fields of GObject.Object */ gTypeInstance: GObject.TypeInstance /* Methods of GObject.Object */ bindProperty(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags): GObject.Binding bindPropertyFull(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags, transformTo: GObject.Closure, transformFrom: GObject.Closure): GObject.Binding forceFloating(): void freezeNotify(): void getData(key: string): object | null getProperty(propertyName: string, value: GObject.Value): void getQdata(quark: GLib.Quark): object | null getv(names: string[], values: GObject.Value[]): void isFloating(): boolean notify(propertyName: string): void notifyByPspec(pspec: GObject.ParamSpec): void ref(): GObject.Object refSink(): GObject.Object runDispose(): void setData(key: string, data?: object | null): void setProperty(propertyName: string, value: GObject.Value): void stealData(key: string): object | null stealQdata(quark: GLib.Quark): object | null thawNotify(): void unref(): void watchClosure(closure: GObject.Closure): void /* Virtual methods of GObject.Object */ vfuncConstructed?(): void vfuncDispatchPropertiesChanged?(nPspecs: number, pspecs: GObject.ParamSpec): void vfuncDispose?(): void vfuncFinalize?(): void vfuncGetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void vfuncNotify?(pspec: GObject.ParamSpec): void vfuncSetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void /* Signals of GObject.Object */ connect(sigName: "notify", callback: (($obj: DLNAAvailableSeekRangeRequest, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify", callback: (($obj: DLNAAvailableSeekRangeRequest, pspec: GObject.ParamSpec) => void)): number emit(sigName: "notify", pspec: GObject.ParamSpec): void on(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: string, callback: any): number connect_after(sigName: string, callback: any): number emit(sigName: string, ...args: any[]): void disconnect(id: number): void on(sigName: string, callback: any): NodeJS.EventEmitter once(sigName: string, callback: any): NodeJS.EventEmitter off(sigName: string, callback: any): NodeJS.EventEmitter static name: string constructor (config?: DLNAAvailableSeekRangeRequest_ConstructProps) _init (config?: DLNAAvailableSeekRangeRequest_ConstructProps): void static supported(message: Soup.Message, handler: HTTPGetHandler): boolean static requested(message: Soup.Message): boolean static $gtype: GObject.Type } export interface DLNAAvailableSeekRangeResponse_ConstructProps extends HTTPResponseElement_ConstructProps { mode?: number startTime?: number endTime?: number startByte?: number endByte?: number rangeLength?: number } export class DLNAAvailableSeekRangeResponse { /* Properties of RygelServer.DLNAAvailableSeekRangeResponse */ mode: number startTime: number endTime: number startByte: number endByte: number rangeLength: number /* Fields of RygelServer.DLNAAvailableSeekRangeResponse */ /* Fields of RygelServer.HTTPResponseElement */ /* Fields of GObject.Object */ gTypeInstance: GObject.TypeInstance /* Methods of RygelServer.DLNAAvailableSeekRangeResponse */ getMode(): number getStartTime(): number getEndTime(): number getStartByte(): number getEndByte(): number getRangeLength(): number /* Methods of RygelServer.HTTPResponseElement */ addResponseHeaders(request: HTTPRequest): void /* Methods of GObject.Object */ bindProperty(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags): GObject.Binding bindPropertyFull(sourceProperty: string, target: GObject.Object, targetProperty: string, flags: GObject.BindingFlags, transformTo: GObject.Closure, transformFrom: GObject.Closure): GObject.Binding forceFloating(): void freezeNotify(): void getData(key: string): object | null getProperty(propertyName: string, value: GObject.Value): void getQdata(quark: GLib.Quark): object | null getv(names: string[], values: GObject.Value[]): void isFloating(): boolean notify(propertyName: string): void notifyByPspec(pspec: GObject.ParamSpec): void ref(): GObject.Object refSink(): GObject.Object runDispose(): void setData(key: string, data?: object | null): void setProperty(propertyName: string, value: GObject.Value): void stealData(key: string): object | null stealQdata(quark: GLib.Quark): object | null thawNotify(): void unref(): void watchClosure(closure: GObject.Closure): void /* Virtual methods of RygelServer.HTTPResponseElement */ vfuncAddResponseHeaders?(request: HTTPRequest): void vfuncToString?(): string /* Virtual methods of GObject.Object */ vfuncConstructed?(): void vfuncDispatchPropertiesChanged?(nPspecs: number, pspecs: GObject.ParamSpec): void vfuncDispose?(): void vfuncFinalize?(): void vfuncGetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void vfuncNotify?(pspec: GObject.ParamSpec): void vfuncSetProperty?(propertyId: number, value: GObject.Value, pspec: GObject.ParamSpec): void /* Signals of GObject.Object */ connect(sigName: "notify", callback: (($obj: DLNAAvailableSeekRangeResponse, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify", callback: (($obj: DLNAAvailableSeekRangeResponse, pspec: GObject.ParamSpec) => void)): number emit(sigName: "notify", pspec: GObject.ParamSpec): void on(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::mode", callback: (($obj: DLNAAvailableSeekRangeResponse, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::mode", callback: (($obj: DLNAAvailableSeekRangeResponse, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::mode", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::mode", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::mode", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::start-time", callback: (($obj: DLNAAvailableSeekRangeResponse, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::start-time", callback: (($obj: DLNAAvailableSeekRangeResponse, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::start-time", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::start-time", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::start-time", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::end-time", callback: (($obj: DLNAAvailableSeekRangeResponse, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::end-time", callback: (($obj: DLNAAvailableSeekRangeResponse, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::end-time", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::end-time", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::end-time", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::start-byte", callback: (($obj: DLNAAvailableSeekRangeResponse, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::start-byte", callback: (($obj: DLNAAvailableSeekRangeResponse, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::start-byte", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::start-byte", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::start-byte", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::end-byte", callback: (($obj: DLNAAvailableSeekRangeResponse, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::end-byte", callback: (($obj: DLNAAvailableSeekRangeResponse, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::end-byte", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::end-byte", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::end-byte", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: "notify::range-length", callback: (($obj: DLNAAvailableSeekRangeResponse, pspec: GObject.ParamSpec) => void)): number connect_after(sigName: "notify::range-length", callback: (($obj: DLNAAvailableSeekRangeResponse, pspec: GObject.ParamSpec) => void)): number on(sigName: "notify::range-length", callback: (...args: any[]) => void): NodeJS.EventEmitter once(sigName: "notify::range-length", callback: (...args: any[]) => void): NodeJS.EventEmitter off(sigName: "notify::range-length", callback: (...args: any[]) => void): NodeJS.EventEmitter connect(sigName: string, callback: any): number connect_after(sigName: string, callback: any): number emit(sigName: string, ...args: any[]): void disconnect(id: number): void on(sigName: string, callback: any): NodeJS.EventEmitter once(sigName: string, callback: any): NodeJS.EventEmitter off(sigName: string, callback: any): NodeJS.EventEmitter static name: string constructor (config?: DLNAAvailableSeekRangeResponse_ConstructProps) _init (config?: DLNAAvailableSeekRangeResponse_ConstructProps): void static new(mode: number, startTime: number, endTime: number, startByte: number, endByte: number): DLNAAvailableSeekRangeResponse static timeOnly(mode: number, startTime: number, endTime: number): DLNAAvailableSeekRangeResponse static $gtype: GObject.Type } export abstract class AudioItemClass { /* Fields of RygelServer.AudioItemClass */ static name: string } export class AudioItemPrivate { static name: string } export abstract class ImageItemClass { /* Fields of RygelServer.ImageItemClass */ static name: string } export class ImageItemPrivate { static name: string } export abstract class LogicalExpressionClass { /* Fields of RygelServer.LogicalExpressionClass */ static name: string } export class LogicalExpressionPrivate { static name: string } export abstract class MediaArtStoreClass { /* Fields of RygelServer.MediaArtStoreClass */ static name: string } export class MediaArtStorePrivate { static name: string } export abstract class MediaObjectsClass { /* Fields of RygelServer.MediaObjectsClass */ static name: string } export class MediaObjectsPrivate { static name: string } export abstract class MusicItemClass { /* Fields of RygelServer.MusicItemClass */ static name: string } export class MusicItemPrivate { static name: string } export abstract class PhotoItemClass { /* Fields of RygelServer.PhotoItemClass */ static name: string } export class PhotoItemPrivate { static name: string } export abstract class RelationalExpressionClass { /* Fields of RygelServer.RelationalExpressionClass */ static name: string } export class RelationalExpressionPrivate { static name: string } export abstract class SimpleContainerClass { /* Fields of RygelServer.SimpleContainerClass */ static name: string } export class SimpleContainerPrivate { static name: string } export abstract class SubtitleClass { /* Fields of RygelServer.SubtitleClass */ getResource: any static name: string } export class SubtitlePrivate { static name: string } export abstract class ThumbnailClass { /* Fields of RygelServer.ThumbnailClass */ getResource: any static name: string } export class ThumbnailPrivate { static name: string } export abstract class VideoItemClass { /* Fields of RygelServer.VideoItemClass */ addSubtitleResources: any static name: string } export class VideoItemPrivate { static name: string } export abstract class MediaContainerClass { /* Fields of RygelServer.MediaContainerClass */ getChildren: any getChildrenFinish: any findObject: any findObjectFinish: any static name: string } export class MediaContainerPrivate { static name: string } export abstract class MediaItemClass { /* Fields of RygelServer.MediaItemClass */ static name: string } export class MediaItemPrivate { static name: string } export abstract class MediaFileItemClass { /* Fields of RygelServer.MediaFileItemClass */ getPrimaryResource: any getExtension: any addEngineResources: any addEngineResourcesFinish: any addAdditionalResources: any static name: string } export class MediaFileItemPrivate { static name: string } export abstract class MediaObjectClass { /* Fields of RygelServer.MediaObjectClass */ addUri: any serialize: any createStreamSourceForResource: any applyDidlLite: any compareByProperty: any static name: string } export class MediaObjectPrivate { static name: string } export abstract class MediaResourceClass { /* Fields of RygelServer.MediaResourceClass */ static name: string } export class MediaResourcePrivate { static name: string } export abstract class MediaServerPluginClass { /* Fields of RygelServer.MediaServerPluginClass */ static name: string } export class MediaServerPluginPrivate { static name: string } export abstract class SearchExpressionClass { /* Fields of RygelServer.SearchExpressionClass */ satisfiedBy: any static name: string } export class SearchExpressionPrivate { static name: string } export abstract class MediaServerClass { /* Fields of RygelServer.MediaServerClass */ static name: string } export class MediaServerPrivate { static name: string } export abstract class MediaEngineClass { /* Fields of RygelServer.MediaEngineClass */ getDlnaProfiles: any getResourcesForItem: any getResourcesForItemFinish: any createDataSourceForResource: any createDataSourceForUri: any getInternalProtocolSchemes: any static name: string } export class MediaEnginePrivate { static name: string } export abstract class HTTPSeekRequestClass { /* Fields of RygelServer.HTTPSeekRequestClass */ static name: string } export class HTTPSeekRequestPrivate { static name: string } export abstract class PlaylistItemClass { /* Fields of RygelServer.PlaylistItemClass */ static name: string } export class PlaylistItemPrivate { static name: string } export abstract class ContentDirectoryClass { /* Fields of RygelServer.ContentDirectoryClass */ static name: string } export class ContentDirectoryPrivate { static name: string } export abstract class HTTPByteSeekRequestClass { /* Fields of RygelServer.HTTPByteSeekRequestClass */ static name: string } export class HTTPByteSeekRequestPrivate { static name: string } export abstract class HTTPByteSeekResponseClass { /* Fields of RygelServer.HTTPByteSeekResponseClass */ static name: string } export class HTTPByteSeekResponsePrivate { static name: string } export abstract class HTTPGetHandlerClass { /* Fields of RygelServer.HTTPGetHandlerClass */ addResponseHeaders: any getDefaultTransferMode: any supportsTransferMode: any getResourceSize: any getResourceDuration: any supportsByteSeek: any supportsTimeSeek: any supportsPlayspeed: any renderBody: any static name: string } export class HTTPGetHandlerPrivate { static name: string } export abstract class HTTPGetClass { /* Fields of RygelServer.HTTPGetClass */ static name: string } export class HTTPGetPrivate { static name: string } export abstract class HTTPItemURIClass { /* Fields of RygelServer.HTTPItemURIClass */ static name: string } export class HTTPItemURIPrivate { static name: string } export abstract class HTTPRequestClass { /* Fields of RygelServer.HTTPRequestClass */ handle: any handleFinish: any findItem: any findItemFinish: any static name: string } export class HTTPRequestPrivate { static name: string } export abstract class HTTPResponseClass { /* Fields of RygelServer.HTTPResponseClass */ end: any static name: string } export class HTTPResponsePrivate { static name: string } export abstract class HTTPResponseElementClass { /* Fields of RygelServer.HTTPResponseElementClass */ addResponseHeaders: any static name: string } export class HTTPResponseElementPrivate { static name: string } export abstract class HTTPServerClass { /* Fields of RygelServer.HTTPServerClass */ getProtocol: any getProtocolInfo: any static name: string } export class HTTPServerPrivate { static name: string } export abstract class HTTPTimeSeekRequestClass { /* Fields of RygelServer.HTTPTimeSeekRequestClass */ static name: string } export class HTTPTimeSeekRequestPrivate { static name: string } export abstract class HTTPTimeSeekResponseClass { /* Fields of RygelServer.HTTPTimeSeekResponseClass */ static name: string } export class HTTPTimeSeekResponsePrivate { static name: string } export abstract class SerializerClass { /* Fields of RygelServer.SerializerClass */ static name: string } export class SerializerPrivate { static name: string } export abstract class PlaySpeedClass { /* Fields of RygelServer.PlaySpeedClass */ static name: string } export class PlaySpeedPrivate { static name: string } export abstract class PlaySpeedRequestClass { /* Fields of RygelServer.PlaySpeedRequestClass */ static name: string } export class PlaySpeedRequestPrivate { static name: string } export abstract class PlaySpeedResponseClass { /* Fields of RygelServer.PlaySpeedResponseClass */ static name: string } export class PlaySpeedResponsePrivate { static name: string } export abstract class DTCPCleartextRequestClass { /* Fields of RygelServer.DTCPCleartextRequestClass */ static name: string } export class DTCPCleartextRequestPrivate { static name: string } export abstract class DTCPCleartextResponseClass { /* Fields of RygelServer.DTCPCleartextResponseClass */ static name: string } export class DTCPCleartextResponsePrivate { static name: string } export abstract class DLNAAvailableSeekRangeRequestClass { /* Fields of RygelServer.DLNAAvailableSeekRangeRequestClass */ static name: string } export class DLNAAvailableSeekRangeRequestPrivate { static name: string } export abstract class DLNAAvailableSeekRangeResponseClass { /* Fields of RygelServer.DLNAAvailableSeekRangeResponseClass */ static name: string } export class DLNAAvailableSeekRangeResponsePrivate { static name: string } export abstract class SearchableContainerIface { /* Fields of RygelServer.SearchableContainerIface */ search: any searchFinish: any getSearchClasses: any setSearchClasses: any static name: string } export abstract class TrackableContainerIface { /* Fields of RygelServer.TrackableContainerIface */ addChild: any addChildFinish: any removeChild: any removeChildFinish: any getServiceResetToken: any setServiceResetToken: any getSystemUpdateId: any static name: string } export abstract class TrackableItemIface { /* Fields of RygelServer.TrackableItemIface */ static name: string } export abstract class VisualItemIface { /* Fields of RygelServer.VisualItemIface */ getWidth: any setWidth: any getHeight: any setHeight: any getColorDepth: any setColorDepth: any getThumbnails: any setThumbnails: any static name: string } export abstract class WritableContainerIface { /* Fields of RygelServer.WritableContainerIface */ addItem: any addItemFinish: any addContainer: any addContainerFinish: any addReference: any addReferenceFinish: any removeItem: any removeItemFinish: any removeContainer: any removeContainerFinish: any getCreateClasses: any setCreateClasses: any static name: string } export abstract class DataSourceIface { /* Fields of RygelServer.DataSourceIface */ preroll: any start: any freeze: any thaw: any stop: any static name: string } export abstract class UpdatableObjectIface { /* Fields of RygelServer.UpdatableObjectIface */ commit: any commitFinish: any static name: string } }
/** * The /tests view for the mneme tool. */ public class AssessmentsView extends ControllerImpl { /** Our log. */ private static Log M_log = LogFactory.getLog(AssessmentsView.class); /** Assessment service. */ protected AssessmentService assessmentService = null; /** Dependency: Question service. */ protected QuestionService questionService = null; /** Dependency: SiteService */ protected SiteService siteService = null; /** tool manager reference. */ protected ToolManager toolManager = null; /** * Shutdown. */ public void destroy() { M_log.info("destroy()"); } /** * {@inheritDoc} */ public void get(HttpServletRequest req, HttpServletResponse res, Context context, String[] params) throws IOException { // sort (optional) if ((params.length != 2) && (params.length != 3)) { throw new IllegalArgumentException(); } // security if (!this.assessmentService.allowManageAssessments(toolManager.getCurrentPlacement().getContext())) { // redirect to error res.sendRedirect(res.encodeRedirectURL(Web.returnUrl(req, "/error/" + Errors.unauthorized))); return; } // default is due date, ascending String sortCode = (params.length > 2) ? params[2] : "0A"; if (sortCode.length() != 2) { throw new IllegalArgumentException(); } AssessmentService.AssessmentsSort sort = figureSort(sortCode); context.put("sort_column", sortCode.charAt(0)); context.put("sort_direction", sortCode.charAt(1)); try { Site site = this.siteService.getSite(toolManager.getCurrentPlacement().getContext()); ToolConfiguration config = site.getToolForCommonId("sakai.mneme"); if (config != null) toolId = config.getId(); context.put("toolId", toolId); } catch (IdUnusedException e) { // redirect to error res.sendRedirect(res.encodeRedirectURL(Web.returnUrl(req, "/error/" + Errors.unauthorized))); return; } // collect the assessments in this context List<Assessment> assessments = this.assessmentService.getContextAssessments(this.toolManager.getCurrentPlacement().getContext(), sort, Boolean.FALSE); context.put("assessments", assessments); context.put("allowFCE", this.assessmentService.allowSetFormalCourseEvaluation(toolManager.getCurrentPlacement().getContext())); // disable the tool navigation to this view context.put("disableAssessments", Boolean.TRUE); // pre-read question counts per pool this.questionService.preCountContextQuestions(toolManager.getCurrentPlacement().getContext()); // render uiService.render(ui, context); } /** * Figure the sort from the sort code. * * @param sortCode * The sort code. * @return The sort. */ protected static AssessmentService.AssessmentsSort figureSort(String sortCode) { // due (0), open (1), title (2), publish (3), view/type (4) AssessmentService.AssessmentsSort sort = null; if (sortCode.charAt(0) == '0') { if (sortCode.charAt(1) == 'A') { sort = AssessmentService.AssessmentsSort.ddate_a; } else { sort = AssessmentService.AssessmentsSort.ddate_d; } } else if (sortCode.charAt(0) == '1') { if (sortCode.charAt(1) == 'A') { sort = AssessmentService.AssessmentsSort.odate_a; } else { sort = AssessmentService.AssessmentsSort.odate_d; } } else if (sortCode.charAt(0) == '2') { if (sortCode.charAt(1) == 'A') { sort = AssessmentService.AssessmentsSort.title_a; } else { sort = AssessmentService.AssessmentsSort.title_d; } } else if (sortCode.charAt(0) == '3') { if (sortCode.charAt(1) == 'A') { sort = AssessmentService.AssessmentsSort.published_a; } else { sort = AssessmentService.AssessmentsSort.published_d; } } else if (sortCode.charAt(0) == '4') { if (sortCode.charAt(1) == 'A') { sort = AssessmentService.AssessmentsSort.type_a; } else { sort = AssessmentService.AssessmentsSort.type_d; } } else { throw new IllegalArgumentException(); } return sort; } public SiteService getSiteService() { return siteService; } /** * Final initialization, once all dependencies are set. */ public void init() { super.init(); M_log.info("init()"); } /** * {@inheritDoc} */ public void post(HttpServletRequest req, HttpServletResponse res, Context context, String[] params) throws IOException { // sort (optional) if ((params.length != 2) && (params.length != 3)) { throw new IllegalArgumentException(); } // security check if (!assessmentService.allowManageAssessments(this.toolManager.getCurrentPlacement().getContext())) { // redirect to error res.sendRedirect(res.encodeRedirectURL(Web.returnUrl(req, "/error/" + Errors.unauthorized))); return; } // default is due date, ascending String sort = (params.length > 2) ? params[2] : "0A"; // for the selected select Values values = this.uiService.newValues(); context.put("ids", values); // for the dates final AssessmentService assessmentService = this.assessmentService; PopulatingSet assessments = uiService.newPopulatingSet(new Factory() { public Object get(String id) { // add a draw to the part Assessment assessment = assessmentService.getAssessment(id); return assessment; } }, new Id() { public String getId(Object o) { return ((Assessment) o).getId(); } }); context.put("assessments", assessments); // read the form String destination = uiService.decode(req, context); // save the dates for (Iterator i = assessments.getSet().iterator(); i.hasNext();) { Assessment assessment = (Assessment) i.next(); try { this.assessmentService.saveAssessment(assessment); } catch (AssessmentPermissionException e) { // redirect to error res.sendRedirect(res.encodeRedirectURL(Web.returnUrl(req, "/error/" + Errors.unauthorized))); return; } catch (AssessmentPolicyException e) { // redirect to error res.sendRedirect(res.encodeRedirectURL(Web.returnUrl(req, "/error/" + Errors.policy))); return; } } // for an add if (destination.equals("ADD")) { try { Assessment assessment = this.assessmentService.newAssessment(this.toolManager.getCurrentPlacement().getContext()); destination = "/assessment_edit/" + assessment.getId() + "/assessments/" + sort; } catch (AssessmentPermissionException e) { // redirect to error res.sendRedirect(res.encodeRedirectURL(Web.returnUrl(req, "/error/" + Errors.unauthorized))); return; } } else if (destination.equals("ARCHIVE")) { for (String id : values.getValues()) { Assessment assessment = this.assessmentService.getAssessment(id); if (assessment != null) { assessment.setArchived(Boolean.TRUE); try { this.assessmentService.saveAssessment(assessment); destination = context.getDestination(); } catch (AssessmentPermissionException e) { // redirect to error res.sendRedirect(res.encodeRedirectURL(Web.returnUrl(req, "/error/" + Errors.unauthorized))); return; } catch (AssessmentPolicyException e) { // redirect to error res.sendRedirect(res.encodeRedirectURL(Web.returnUrl(req, "/error/" + Errors.policy))); return; } } } } else if (destination.equals("PUBLISH")) { for (String id : values.getValues()) { Assessment assessment = this.assessmentService.getAssessment(id); if (assessment != null) { try { // for invalid assessments, the setPublished will be ignored assessment.setPublished(Boolean.TRUE); this.assessmentService.saveAssessment(assessment); } catch (AssessmentPermissionException e) { // redirect to error res.sendRedirect(res.encodeRedirectURL(Web.returnUrl(req, "/error/" + Errors.unauthorized))); return; } catch (AssessmentPolicyException e) { // redirect to error res.sendRedirect(res.encodeRedirectURL(Web.returnUrl(req, "/error/" + Errors.policy))); return; } } } destination = context.getDestination(); } else if (destination.equals("UNPUBLISH")) { for (String id : values.getValues()) { Assessment assessment = this.assessmentService.getAssessment(id); if (assessment != null) { try { assessment.setPublished(Boolean.FALSE); this.assessmentService.saveAssessment(assessment); } catch (AssessmentPermissionException e) { // redirect to error res.sendRedirect(res.encodeRedirectURL(Web.returnUrl(req, "/error/" + Errors.unauthorized))); return; } catch (AssessmentPolicyException e) { // redirect to error res.sendRedirect(res.encodeRedirectURL(Web.returnUrl(req, "/error/" + Errors.policy))); return; } } } destination = context.getDestination(); } else if (destination.equals("DELETE")) { for (String id : values.getValues()) { Assessment assessment = this.assessmentService.getAssessment(id); if (assessment != null) { try { if (this.assessmentService.allowRemoveAssessment(assessment)) { this.assessmentService.removeAssessment(assessment); } } catch (AssessmentPermissionException e) { // redirect to error res.sendRedirect(res.encodeRedirectURL(Web.returnUrl(req, "/error/" + Errors.unauthorized))); return; } catch (AssessmentPolicyException e) { // redirect to error res.sendRedirect(res.encodeRedirectURL(Web.returnUrl(req, "/error/" + Errors.policy))); return; } } } destination = context.getDestination(); } else if (destination.startsWith("DUPLICATE:")) { String[] parts = StringUtil.split(destination, ":"); if (parts.length != 2) { throw new IllegalArgumentException(); } String aid = parts[1]; try { Assessment assessment = this.assessmentService.getAssessment(aid); if (assessment == null) { throw new IllegalArgumentException(); } this.assessmentService.copyAssessment(toolManager.getCurrentPlacement().getContext(), assessment); destination = context.getDestination(); } catch (AssessmentPermissionException e) { // redirect to error res.sendRedirect(res.encodeRedirectURL(Web.returnUrl(req, "/error/" + Errors.unauthorized))); return; } } else if (destination.equals("/assmt_settings_choice")) { // add the selected ids to the destination StringBuilder buf = new StringBuilder(); buf.append(destination); buf.append("/" + sort); buf.append("/"); for (String id : values.getValues()) { buf.append(id); buf.append("+"); } buf.setLength(buf.length() - 1); destination = buf.toString(); } else if (destination.trim().startsWith("/assessment_export")) { // add the selected ids to the destination StringBuilder buf = new StringBuilder(); buf.append("/assessment_export/"); String[] ids = values.getValues(); int count = 1; for (String id : ids) { buf.append(id); if (count != ids.length) buf.append("+"); count++; } buf.append("/"+sort); buf.setLength(buf.length()); destination = buf.toString(); } res.sendRedirect(res.encodeRedirectURL(Web.returnUrl(req, destination))); } /** * Set the AssessmentService. * * @param service * The AssessmentService. */ public void setAssessmentService(AssessmentService service) { this.assessmentService = service; } /** * Set the QuestionService. * * @param service * The QuestionService. */ public void setQuestionService(QuestionService service) { this.questionService = service; } public void setSiteService(SiteService siteService) { this.siteService = siteService; } /** * Set the tool manager. * * @param manager * The tool manager. */ public void setToolManager(ToolManager manager) { toolManager = manager; } }
async def copy_bracket(self, ctx, index_from: int, index_to: int): tournament = self.get_tournament(ctx.guild.id) brackets = tournament.brackets if index_from > 0 and index_from <= len(brackets) and index_to > 0 and index_to <= len(brackets): bracket_from = brackets[index_from - 1] bracket_to = brackets[index_to - 1] bracket_to.post_result_channel_id = bracket_from.post_result_channel_id bracket_to.current_round = bracket_from.current_round for spreadsheet_type in Bracket.get_spreadsheet_types().keys(): spreadsheet_from = bracket_from.get_spreadsheet_from_type(spreadsheet_type) if spreadsheet_from: spreadsheet_to = bracket_to.get_spreadsheet_from_type(spreadsheet_type) if not spreadsheet_to: spreadsheet_to = bracket_to.create_spreadsheet_from_type(self.bot, spreadsheet_type) spreadsheet_from.copy_to(spreadsheet_to) self.bot.session.update(spreadsheet_to) await self.send_reply(ctx, ctx.command.name, "success", bracket_from.name, bracket_to.name) return raise commands.UserInputError()
def load_data(self): self.train_data_text = self._load_csv(os.path.join(self.path, "train.csv")) self.val_data_text = self._load_csv(os.path.join(self.path, "valid.csv")) self.test_data_text = self._load_csv(os.path.join(self.path, "test_no_label.csv")) self.sentences = ( self.train_data_text[0] + self.val_data_text[0] + [choice for choices in self.train_data_text[1] for choice in choices] + [choice for choices in self.val_data_text[1] for choice in choices] ) log.info("\tFinished loading CosmosQA data.")
/** * lun_mode_store() - sets the LUN mode of the host * @dev: Generic device associated with the host. * @attr: Device attribute representing the LUN mode. * @buf: Buffer of length PAGE_SIZE containing the LUN mode in ASCII. * @count: Length of data resizing in @buf. * * The CXL Flash AFU supports a dummy LUN mode where the external * links and storage are not required. Space on the FPGA is used * to create 1 or 2 small LUNs which are presented to the system * as if they were a normal storage device. This feature is useful * during development and also provides manufacturing with a way * to test the AFU without an actual device. * * 0 = external LUN[s] (default) * 1 = internal LUN (1 x 64K, 512B blocks, id 0) * 2 = internal LUN (1 x 64K, 4K blocks, id 0) * 3 = internal LUN (2 x 32K, 512B blocks, ids 0,1) * 4 = internal LUN (2 x 32K, 4K blocks, ids 0,1) * * Return: The size of the ASCII string returned in @buf. */ static ssize_t lun_mode_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct Scsi_Host *shost = class_to_shost(dev); struct cxlflash_cfg *cfg = (struct cxlflash_cfg *)shost->hostdata; struct afu *afu = cfg->afu; int rc; u32 lun_mode; rc = kstrtouint(buf, 10, &lun_mode); if (!rc && (lun_mode < 5) && (lun_mode != afu->internal_lun)) { afu->internal_lun = lun_mode; afu_reset(cfg); scsi_scan_host(cfg->host); } return count; }
<filename>waiter/src/main/java/ru/shaplov/job4j/patterns/electronicwaiter/menu/drink/additives/SugarOrder.java<gh_stars>0 package ru.shaplov.job4j.patterns.electronicwaiter.menu.drink.additives; import ru.shaplov.job4j.patterns.electronicwaiter.Order; import ru.shaplov.job4j.patterns.electronicwaiter.annotation.Additivity; import ru.shaplov.job4j.patterns.electronicwaiter.menu.AbstractAdditivity; import ru.shaplov.job4j.patterns.electronicwaiter.menu.drink.Drink; @Additivity(value = "Сахар", price = 10.0) public class SugarOrder extends AbstractAdditivity implements Drink { public SugarOrder(Order order) { super(order); if (!Drink.class.isAssignableFrom(order.getClass())) { throw new IllegalArgumentException("не напиток."); } } }
/* All Contributors (C) 2020 */ package io.github.dreamylost.practice.test; import io.github.dreamylost.practice.NumberOf1; import org.junit.Assert; import org.junit.Test; /** * 迁移代码,原提交者Perkins * * @author Perkins * @version v1.0 * @time 2019-06-19 */ public class NumberOf1_test { @Test public void testNumberOf1_1() { Assert.assertEquals(0, new NumberOf1().NumberOf1_1(0)); Assert.assertEquals(1, new NumberOf1().NumberOf1_1(1)); Assert.assertEquals(2, new NumberOf1().NumberOf1_1(5)); Assert.assertEquals(5, new NumberOf1().NumberOf1_1(31)); } @Test public void NumberOf1_2() { Assert.assertEquals(0, new NumberOf1().NumberOf1_2(0)); Assert.assertEquals(1, new NumberOf1().NumberOf1_2(1)); Assert.assertEquals(5, new NumberOf1().NumberOf1_2(31)); } @Test public void NumberOf1_2_low() { Assert.assertEquals(0, new NumberOf1().NumberOf1_2_low(0)); Assert.assertEquals(1, new NumberOf1().NumberOf1_2_low(1)); Assert.assertEquals(2, new NumberOf1().NumberOf1_2_low(5)); Assert.assertEquals(5, new NumberOf1().NumberOf1_2_low(31)); } }
<reponame>diegospd/bytecode-interpreter<filename>src/Helpers/Bytecode.hs module Helpers.Bytecode where import Control.Concurrent.STM.TMVar import Control.Monad.STM import Lens.Micro.Platform import Types.Bytecode import Types.StackMachine loadNumber :: Int -> Bytecode loadNumber = LowLevel . LoadVal . Num loadTrue :: Bytecode loadTrue = LowLevel . LoadVal . Boolean $ True loadFalse :: Bytecode loadFalse = LowLevel . LoadVal . Boolean $ False loadEmptyChannel :: STM Bytecode loadEmptyChannel = do emptyChannel <- newEmptyTMVar let channelValue = Channel emptyChannel return . LowLevel . LoadVal $ channelValue readVar :: Identifier -> Bytecode readVar = LowLevel . ReadVar writeVar :: Identifier -> Bytecode writeVar = LowLevel . WriteVar true :: Value -> Bool true (Boolean True) = True true _ = False consumeBytecode :: STM StackMachineSync -> STM StackMachineSync consumeBytecode stateSync = do state <- stateSync return $ state & bytecodeSync %~ tail
Yasir Afifi said he’s pretty sure he meets the profile of a Muslim on the FBI watch list: He found a GPS tracking device attached to his car last Sunday. Two days later, on Tuesday, he said the FBI came calling and asked for the device back. “I’m half-Arab, a young Muslim, my dad was a religious role model in the community,” the 20-year-old Santa Clara resident said Friday. “I travel overseas for work and to visit my brothers in Egypt. It’s their ticket to bother me forever.” Afifi says the FBI has no reason to watch him. He said he’s done nothing wrong. The FBI did not return numerous phone calls from the Mercury News. However, according to Afifi and his attorney, Zahra Billoo, what happened is an example of federal authorities going on what Billoo called “fishing expeditions. It’s very common in this community,” she said. Afifi said the strange series of events began Sunday, when he took his car in for an oil change to a garage not far from his Santa Clara home. As the car was raised, Afifi said he noticed “a wire hanging out.” Then he noticed “a black, glimmering device.” Mazher Khan, owner of Ali’s Auto Care, had no idea what it was but he agreed to yank it out. Afifi left with the device and drove home. On Tuesday, Afifi said he had just gotten home from work when one of his roommates came in and said, “There are two suspicious people standing right by your car in the complex.” Afifi said he walked down to his car and backed out onto the road, but two SUVs pull up. One of the officers said, “did you know your tags are expired?” Afifi said. “I said, ‘Yeah, I know, I’m going to buy them this week. Is that why you pulled me over?’ “ The man showed him his FBI badge, Afifi said, and asked if he knew why the officers were there. Two FBI agents and four Santa Clara police officers were in the SUVs. Afifi said he told the agent he had a pretty good idea when he was asked more questions. Were you at a mechanic’s shop last Sunday? “Yes.” “All right, where’s the device you found under your hood,” the agent said, according to Afifi. “He goes, ‘Yeah, we put it there.’ “ After pressure from the agent, Afifi said he felt intimidated, even though “I was answering all of their questions.” He became concerned when the agent said, “We’re going to arrest you for obstruction of justice if you don’t cooperate.” Afifi said he told officers the device was in his living room and agreed to walk with them the short distance back to his house. He asked the two FBI agents, a man and a woman, to wait outside while he retrieved the device. “I gave it back to them and said, ‘Is this what you needed?’ ” Afifi said. “He goes, ‘Yeah, this is it.’ “ According to Afifi, “that’s when the weird stuff starts happening. They asked ‘Have you ever been overseas, had any type of training in Yemen or Iran? Any kind of abnormal activity?’ “ “My answer was ‘no, no, I have no idea how I can help you.’ “ Except for contacting Billoo, director of the Bay Area chapter of Council on American-Islamic Relations, a Muslim-American civil rights advocacy group, and giving a few interviews on Friday, Afifi said the rest of his week was pretty uneventful. But Billoo said she worries about the ongoing focus on “regular people” who happen to be Muslim. “I think this might have been a situation where they made a mistake,” she said. “It’s so egregious.” Contact Linda Goldston at 408-920-5862.
<filename>LC_DVR/LC/src/main/java/com/example/administrator/lc_dvr/module/lc_dvr_files_manager/load_video_thumbnail/MyVideoThumbLoader.java<gh_stars>0 package com.example.administrator.lc_dvr.module.lc_dvr_files_manager.load_video_thumbnail; import android.annotation.SuppressLint; import android.graphics.Bitmap; import android.os.AsyncTask; import android.provider.MediaStore; import android.support.v4.util.LruCache; import android.widget.ImageView; import com.example.administrator.lc_dvr.common.utils.BitmapUtils; import com.nostra13.universalimageloader.core.ImageLoader; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; public class MyVideoThumbLoader { private LruCache<String, Bitmap> lruCache; @SuppressLint("NewApi") public MyVideoThumbLoader() { int maxMemory = (int) Runtime.getRuntime().maxMemory();//��ȡ���������ڴ� int maxSize = maxMemory / 4; lruCache = new LruCache<String, Bitmap>(maxSize) { @Override protected int sizeOf(String key, Bitmap value) { //�����������ÿ�δ��뻺���ʱ����� return value.getByteCount(); } }; } public void addVideoThumbToCache(String path, Bitmap bitmap) { if (getVideoThumbToCache(path) == null) { //��ǰ��ַû�л���ʱ������� lruCache.put(path, bitmap); } } public Bitmap getVideoThumbToCache(String path) { return lruCache.get(path); } public void showThumbByAsynctack(String path, ImageView imgview, String videoName) { if (getVideoThumbToCache(path) == null) { if (new File(BitmapUtils.getSDPath() + "/VOC/Cache/" + videoName + ".png").exists()) { ImageLoader.getInstance().displayImage("file://" + BitmapUtils.getSDPath() + "/VOC/Cache/" + videoName + ".png", imgview); } else { //�첽���� new MyBobAsynctack(imgview, path, videoName).execute(path); } } else { imgview.setImageBitmap(getVideoThumbToCache(path)); } } /** * 保存bitmap到SD卡 * * @param bmp * @param bitName * @return * @throws IOException */ public boolean saveMyBitmap(Bitmap bmp, String bitName) throws IOException { File dirFile = new File(BitmapUtils.getSDPath() + "/VOC/Cache/"); if (!dirFile.exists()) { dirFile.mkdirs(); } File f = new File(BitmapUtils.getSDPath() + "/VOC/Cache/" + bitName + ".png"); boolean flag = false; f.createNewFile(); FileOutputStream fOut = null; try { fOut = new FileOutputStream(f); bmp.compress(Bitmap.CompressFormat.JPEG, 50, fOut); flag = true; } catch (FileNotFoundException e) { e.printStackTrace(); } try { fOut.flush(); } catch (IOException e) { e.printStackTrace(); } try { fOut.close(); } catch (IOException e) { e.printStackTrace(); } return flag; } class MyBobAsynctack extends AsyncTask<String, Void, Bitmap> { private ImageView imgView; private String path; private String videoName; public MyBobAsynctack(ImageView imageView, String path, String videoName) { this.imgView = imageView; this.path = path; this.videoName = videoName; } @Override protected Bitmap doInBackground(String... params) { Bitmap bitmap = VideoUtil.createVideoThumbnail(params[0], 70, 50, MediaStore.Video.Thumbnails.MICRO_KIND); //���뻺���� if (getVideoThumbToCache(params[0]) == null) { if (path != null && bitmap != null) { addVideoThumbToCache(path, bitmap); try { saveMyBitmap(bitmap, videoName); } catch (IOException e) { e.printStackTrace(); } } } return bitmap; } @Override protected void onPostExecute(Bitmap bitmap) { if (imgView.getTag().equals(path)) { if (bitmap != null) { imgView.setImageBitmap(bitmap); } } } } }
<reponame>BaSO4/elasticsql package elasticsql import ( "encoding/json" "fmt" "strings" ) func buildDSL(queryMapStr, queryFrom, querySize string, aggStr string, orderByArr []string, colArr []string) string { resultMap := make(map[string]interface{}) resultMap["query"] = queryMapStr resultMap["from"] = queryFrom resultMap["size"] = querySize if len(aggStr) > 0 { resultMap["aggregations"] = aggStr } if len(orderByArr) > 0 { resultMap["sort"] = fmt.Sprintf("[%v]", strings.Join(orderByArr, ",")) } if len(colArr) > 0 { cols, _ := json.Marshal(colArr) resultMap["_source"] = string(cols) } // keep the travesal in order, avoid unpredicted json var keySlice = []string{"query", "_source", "from", "size", "sort", "aggregations"} var resultArr []string for _, mapKey := range keySlice { if val, ok := resultMap[mapKey]; ok { resultArr = append(resultArr, fmt.Sprintf(`"%v" : %v`, mapKey, val)) } } return "{" + strings.Join(resultArr, ",") + "}" }
t=int(input()) a=[] b=[] k=[] for i in range(t): ta,tb,tk=map(int,input().split(' ')) a.append(ta) b.append(tb) k.append(tk) for i in range(t): res=a[i]-b[i] d=0 if k[i]%2==0 else 1 print((k[i]//2)*res+d*a[i])
def main(self): self._main_call_before_start_funcs() try: self._main_loop.run() except KeyboardInterrupt: pass self._main_call_after_stop_funcs()
Local News, Nature & Weather, Seasonal & Current Events By Cait Russell Published: August 13 2014 The August 13th rainstorm dumped as much 13 inches of rain in some areas. The heavy flooding prompted the Town of Islip to declare a state of emergency, and Governor Cuomo to dispatch emergency recovery responders to assist with the clean up and recovery post-storm. This morning, there were closures on eleven major roadways on Long Island, including the Long Island Expressway, Northern State Parkway, Sunrise Highway, and the Wantagh State Parkway. Although the rain has stopped, and roadways are once again becoming drivable, there is still major flooding across Long Island, and Islip, as well as other hard-hit areas, will likely continue to recover from today's storm for days to come. Here are the current reported rainfall totals for Long Island for August 13th, 2014: Nassau County Massapeuqa - 8.2" Wantagh - 7.84" Merrick - 6.81" Lido Beach - 5.3" Old Bethpage - 5.27" Bellmore - 5.2" Garden City - 4.75" Plainview - 4.7" Long Beach - 4.64" Syosset - 4.01" Muttontown - 3.41 East Hills - 3.16" Floral Park - 2.8" Bayville - 2.63" Malverne - 0.98" Suffolk County Islip Airport - 13.27" Holbrook - 12.57 " West Islip - 11.50" Bay Shore - 11.35" Islip - 10.20" Deer Park - 8.40" Ronkonkoma - 8.20" Farmingville - 7.73 " Centereach - 6.71" St. James - 6.11" Smithtown - 5.17" Port Jefferson Station - 5.10" East Farmingdale - 4.93" Medford - 4.45" Mount Sinai - 4.40" East Northport - 4.40" Centerport - 3.18" Upton - 1.75" Stony Brook - 1.59" Shirley Airport - 1.15" Southampton - 0.70" Westhampton Airport - 0.68" Orient - 0.62" 1 NNE Montauk - 0.14" Although the rain has stopped, and the sun is shining, some local roads may still be experiencing serious flooding and closures. Before you hit the road, be sure to check out LongIsland.com's Traffic Center, which features traffic updates in real time. You can also take a peek at the current traffic conditions over in our Traffic Cam Center, and get the latest transit updates over at our LIRR Schedule & Trip Planning Guide. If your home has suffered flood damage, be sure to check out "What to Do After a Flood" - our Guide to proper clean up and sanitation post-flood. Flood waters can cause serious damage to homes, and proper post-flood clean up can help to prevent mold, and other serious problems down the line. Have a photo of flooding in your neighborhood? Email it to us, and we'll add it to our Floodageddon Photo Gallery. How much rain did your neighborhood have? Let us know, and we'll update our list. [Source: The National Weather Service.] Pictured in the Feature Photo: Flooding on Union Avenue in Bay Shore.
DETECTION OF CANDIDA SPP. THAT CAUSES VULVOVAGINITIS IN WOMEN THAT USE CONTRACEPTIVE METHODS. OBJECTIVE The aim: To determine the distribution of Candida spp. within different age groups and contraceptive methods in women with vulvovaginitis, as well as the susceptibility of Candida spp. to commonly used antifungals. PATIENTS AND METHODS Materials and methods: High vaginal swabs were taken from 98 women aged 18 to 50 with vulvovaginitis who used contraceptives and attended the Women and Children Hospital in Al-Diwaniyah; after diagnosis of Candida species, the sensitivity of Candida spp. to some antifungals was studied. RESULTS Results: The results showed (43/98) women (43.87%) used IUD, (15/98) women (15.30%) used birth control pills, (7/98) women (7.14%) used an injection of contraceptive, (5/98) women (5.10%) used contraceptive suppositories, and (28/98) women (28.57%) did not use any contraceptives. Candida spp. was found in (48/83) specimens (57.831%) from women who used contraceptives and only (11/28) specimens (39.285%) from women who did not use contraceptives. Only (59/98) vaginal specimens tested positive for vaginal candidiasis, (28/59) isolates (47.457%) for C. albicans, then (16/59) isolates for C. glabrata (27.118%), (9/59) isolates (15.254%) for C. tropicalis and (6/59) isolates (10.169%) for C. krusei. Nystatin was the best treatment for all Candida spp. under study, and the MIC was 6.25, and the MFC was 50 for all antifungals and Candida species under study. CONCLUSION Conclusions: C. albicans was the most prevalent cause of vulvovaginal candidiasis, while C. glabrata was the most common non-albicans species in women aged 26 to 35; using an IUD was associated with an increased infection of vulvovaginal candidiasis, and nystatin was the most effective treatment.
<reponame>Pingviinituutti/homectl use homectl_types::event::TxEventChannel; use super::{ devices::Devices, groups::Groups, integrations::Integrations, rules::Rules, scenes::Scenes, }; #[derive(Clone)] pub struct AppState { pub integrations: Integrations, pub groups: Groups, pub scenes: Scenes, pub devices: Devices, pub rules: Rules, pub sender: TxEventChannel, }
Each coin contains 1 oz of .9999 fine Silver. This MintDirect® tube contains 25 Silver Canadian Maple Leafs. tube contains 25 Silver Canadian Maple Leafs. Mintage of just 1,000,000 coins. Obverse: Right-facing profile of Queen Elizabeth II, along with the year and face value. Reverse: Showcases a detailed single maple leaf, with the “25” celebration mark, as well as the coin's weight and purity. Sovereign coin backed by the Canadian government. Securely store your tubes by adding an officialto your order.MintDirect® tubes are the perfect way to begin your investment in Silver bullion. Add the 2013 Silver Canadian Maple Leaf 25th anniversary 25-Coin MintDirect® tube to your cart today!APMEX uses a special machine to ensure the products you receive are completely sealed once they are removed directly from the mint boxes. The mint tubes are placed on a conveyor leading into the machine and the sealing process seals both ends of each tube with tamper-evident packaging. If this tube has been opened in any way, you will know. After the process is completed, the tube is removed from the machine and then checked to ensure the quality of the packaging meets our exacting standards. You now have a finished tube ofOnce checked for quality, thetubes are stored back in the vault until they are ordered by our customers. By using this process, APMEX can guarantee the coins you receive are in exactly the same condition and packaging as they were when they left the Royal Canadian Mint.The MintDirect® process provides you the assurance this product has not been opened, sorted or searched. Learn more aboutproducts from APMEX.Note: The MintDirect® process does not guarantee protection from spotting or tarnishing that normally occurs in chemically active metals, such as Gold, Silver and Platinum.
/** * An alternative entry point to the Cobol extractor, targeted for use by LGTM. */ public class AutoBuild extends CommonBuild { private LgtmCobolProject project; public AutoBuild() { this.project = new LgtmCobolProject(LgtmYmlConfig.SRC); project.setDefaultFormat(FORMAT); project.setDefaultTabLength(TAB_LENGTH); project.setDefaultPreprocessing(PREPROCESSING); project.setPredicateForSourceText(new Glob(SOURCE_GLOBS)); project.setPredicateForLibraryText(new Glob(LIBRARY_GLOBS)); } /** * Perform extraction. */ @Override protected int runApi() { try { extractSource(); return 0; } catch (IOException e) { throw new ResourceError("an extraction error occurred", e); } } /** * Extract all supported candidate files that pass the filters. */ private void extractSource() throws IOException { // This is to aid troubleshooting. LgtmYmlConfig.logConfig(); final Path[] currentRoot = new Path[1]; FileVisitor<? super Path> visitor = new SimpleFileVisitor<Path>() { @Override public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { if (attrs.isSymbolicLink()) return SKIP_SUBTREE; if (!file.equals(currentRoot[0]) && EXCLUDES.contains(file)) return SKIP_SUBTREE; if (FILTERS.includeFile(getNormalizedPath(file))) project.add(file); return super.visitFile(file, attrs); } @Override public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException { if (!dir.equals(currentRoot[0]) && (EXCLUDES.contains(dir) || dir.toFile().isHidden())) return SKIP_SUBTREE; else return super.preVisitDirectory(dir, attrs); } private String getNormalizedPath(Path file) { final String path = file.toString().replace('\\', '/'); if (path.charAt(0) == '/') return path; else return "/" + path; } }; for (Path root : INCLUDES) { currentRoot[0] = root; Files.walkFileTree(currentRoot[0], visitor); } int successfulParses = 0; for (Path p : project.getFiles()) { final Info info = process(p.toFile(), project); if (info.seenParseError) logger.error("Failed to parse " + p + ". Ignoring."); else successfulParses += 1; if (info.seenTrapError) throw new ResourceError("An extraction error occurred."); } // LGTM-2979 : If all COBOL files in the project failed to parse, do not // accept the project as a COBOL project. if (!ACCEPT_FAILING_PROJECT && project.getFiles().size() > 0 && successfulParses == 0) throw new ResourceError("Failed to parse any file as COBOL."); } public static void main(String[] args) { int ret = 1; try (CliCommand cmd = new AutoBuild()) { ret = cmd.run(args); } catch (Exception | Error e) { e.printStackTrace(); LoggerFactory.getLogger(AutoBuild.class) .error("Error during COBOL extraction.", e); ret = 0xDA5A; } finally { System.exit(ret); } } }
<reponame>philopon/apiary<filename>src/Control/Monad/Apiary.hs<gh_stars>10-100 module Control.Monad.Apiary ( ApiaryT -- * Runner -- ** Apiary -> Application , runApiaryTWith , runApiaryWith , runApiary , getApiaryTWith , getApiaryWith , getApiary , ApiaryConfig(..) -- * execute action , action -- * middleware , middleware -- * API documentation , group , document , precondition , noDoc -- * not export from Web.Apiary , apiaryConfig , apiaryExt ) where import Control.Monad.Apiary.Internal import Control.Monad.Apiary.Action.Internal
/// Save the block and its header fn save_block(&self, b: &Block) -> Result<(), Error> { let batch = self.db .batch() .put_ser( &to_key(BLOCK_PREFIX, &mut b.hash().to_vec())[..], b, )? .put_ser( &to_key(BLOCK_HEADER_PREFIX, &mut b.hash().to_vec())[..], &b.header, )?; batch.write() }
Label: 2morrows Victory Records Genre: Future-Soul Members: J’Danna Based: London Sounds Like: Jamie xx, Alicia Keys, Szjerdene Links: 2morrows Victory Facebook Some of you might remember the brilliant track-cycling, London Hip-hop group 2morrow’s Victory that we brought you a couple of weeks ago. Well, last week, their own record label unveiled two new signings at Gilles Peterson’s Worldwide Awards that we thought were worth telling you about. Joey and J’Danna made an unexpected appearance at the London awards to play an impressive Gill Scott Heron tribute and two tracks have been made available. Pressed to choose between the two, J’Danna just pips it at the post. Her Future-Soul take on the eponymous track from Gil’s 1974 album combines her amazing voice with some interesting production, reminiscent of the boom-boom-clap beat on Jamie xx’s New York Is Killing Me (coincidence both are covering Mr Scott-Heron?). Unfortunately we can find out nothing more on the pair, but we’ll definitely be keeping our ears peeled. Go like the 2morrows Victory Facebook page to keep up to date with their label’s latest movements. Winter in America is also free to download from here. Joey’s version of The Revolution Will Not Be Televised, brings more of a Hip-hop twist to the original. And if you’re so-inclined, here are the original songs that J’Danna and Joey are covering:
/** * Thrown when an unusable response is encountered while inspecting an instance. * * @author Christian Trimble */ public class InvalidResponse extends InspectionException { /** * */ private static final long serialVersionUID = 1L; protected HttpResponse response; public InvalidResponse(HttpResponse response) { super(); this.response = response; } public InvalidResponse(String message, HttpResponse response, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { super(message, cause, enableSuppression, writableStackTrace); this.response = response; } public InvalidResponse(String message, HttpResponse response, Throwable cause) { super(message, cause); this.response = response; } public InvalidResponse(String message, HttpResponse response) { super(message); this.response = response; } public InvalidResponse(HttpResponse response, Throwable cause) { super(cause); this.response = response; } public HttpResponse getResponse() { return this.response; } }
#include<bits/stdc++.h> using namespace std; typedef long long ll; #define pb push_back ll n,x,t,s,k; vector<ll>v,v1,v2,d1,d2; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); cin>>t; while(t--){ cin>>n>>s>>k; map<ll,ll>m; for(int i=0; i<k; i++){ cin>>x; m[x]=1; } ll f=0,cnt=0,ans1=INT_MAX,ans2=INT_MAX; for(int i=s; i<=n && cnt<2000 ; i++,cnt++){ if(!m[i]){ //cout<<"::"<<i<<endl; ans1=i; f=1; break; } } cnt=0; for(int i=s; i>=1 && cnt<2000 ; i--,cnt++){ if(!m[i]){ //cout<<"::"<<i<<endl; ans2=i; f=1; break; } } //cout<<" ANS! "<<ans1<<" "<<ans2<<endl; ll c1=abs(s-ans1); ll c2=abs(s-ans2); if(c1<c2) cout<<c1<<endl; else cout<<c2<<endl; } } ///author-joydip007x /// ///Time&Date-Whenever i submit///
<gh_stars>10-100 //+--------------------------------------------------------------------------- // // Microsoft Windows // Copyright (C) Microsoft Corporation, 1992 - 1994. // // File: ole2splt.cxx // // Contents: OLE2 API whose implementation is split between 16/32 // // History: 07-Mar-94 DrewB Created // //---------------------------------------------------------------------------- #include <headers.cxx> #pragma hdrstop #include <ole2sp.h> #include <ole2int.h> #include <ole2ver.h> #include <olecoll.h> #include <map_kv.h> #include <map_htsk.h> #include <etask.hxx> #include <call32.hxx> #include <apilist.hxx> // MFC HACK ALERT!!! The followind constant is needed // for an MFC workaround. See OleInitialize for details #define CLIPBOARDWNDCLASS "CLIPBOARDWNDCLASS" //+--------------------------------------------------------------------------- // // Function: OleInitialize, Split // // Synopsis: // // Effects: // // Arguments: [pMalloc] -- // // Requires: // // Returns: // // Signals: // // Modifies: // // Algorithm: // // History: 2-28-94 kevinro Created // 05-26-94 AlexT Return correct success code // 08-22-94 AlexGo added MFC CreateWindow hack // // Notes: // //---------------------------------------------------------------------------- STDAPI OleInitialize(LPMALLOC pMalloc) { HTASK htask; Etask etask; HRESULT hrCoInit, hrOleInit; static BOOL fCreatedClipWindowClass = FALSE; /* This version of ole2.dll simply needs to work with the same major build of compobj.dll. Future versions of ole2.dll might be restricted to certain builds of compobj.dll. */ if (HIWORD(CoBuildVersion()) != rmm) { return ResultFromScode(OLE_E_WRONGCOMPOBJ); } /* if already initialize one or more times, just bump count and return. */ if (LookupEtask(htask, etask) && etask.m_oleinits != 0) { etask.m_oleinits++; thkVerify(SetEtask(htask, etask)); return ResultFromScode(S_FALSE); } /* Initialize the 16-bit side of compobj */ hrCoInit = CoInitialize(pMalloc); if (SUCCEEDED(GetScode(hrCoInit))) { /* Thunk OleInitialize Never pass on the IMalloc */ pMalloc = NULL; hrOleInit = (HRESULT)CallObjectInWOW(THK_API_METHOD(THK_API_OleInitialize), PASCAL_STACK_PTR(pMalloc) ); if (FAILED(GetScode(hrOleInit))) { CoUninitialize(); return(hrOleInit); } thkVerify(LookupEtask(htask, etask) && etask.m_oleinits == 0); etask.m_oleinits++; thkVerify(SetEtask(htask, etask)); } // Since we call 32-bit CoInitialize and then call 32-bit OleInitialize, // and since the latter internally calls CoInitialize (a second time), we // want to return the HRESULT of the call to CoInitialize since some // applications look for S_OK (and our call to OleInitialize will return // S_FALSE since it will be the second call to CoInitialize). // MFC HACK ALERT!! MFC2.5 (16bit) has a hack where they scan the // window hierarchy for a window named "CLIPBOARDWNDCLASS". They then // subclass this window and do their own processing for clipboard // windows messages. // // In order to make them work, we create a dummy window for MFC to party // on. This allows them to successfully subclass and not interfere // with 32bit OLE processing. (since it's a dummy window) // // NB!! We do not bother with resource cleanup; we'll leave this window // around until the process exits. We also don't care about errors // here. In the off chance that one of the calls fails and we *don't* // create a window that MFC can party on, then MFC *debug* apps will // popup an assert dialog. You can safely click 'OK' on this dialog // and the app will proceed without undue trauma. if( !fCreatedClipWindowClass ) { WNDCLASS wc; // Register Clipboard window class // wc.style = 0; wc.lpfnWndProc = DefWindowProc; wc.cbClsExtra = 0; wc.cbWndExtra = 4; wc.hInstance = hmodOLE2; wc.hIcon = NULL; wc.hCursor = NULL; wc.hbrBackground = NULL; wc.lpszMenuName = NULL; wc.lpszClassName = CLIPBOARDWNDCLASS; // don't bother checking for errors RegisterClass(&wc); fCreatedClipWindowClass = TRUE; } CreateWindow(CLIPBOARDWNDCLASS,"",WS_POPUP,CW_USEDEFAULT, CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT, NULL,NULL,hmodOLE2,NULL); return hrOleInit; } //+--------------------------------------------------------------------------- // // Function: OleUninitialize, Split // // Synopsis: // // Effects: // // Arguments: [void] -- // // Requires: // // Returns: // // Signals: // // Modifies: // // Algorithm: // // History: 2-28-94 kevinro Created // // Notes: // //---------------------------------------------------------------------------- STDAPI_(void) OleUninitialize(void) { HTASK htask; Etask etask; /* If not init, just return */ if (!LookupEtask(htask, etask) || etask.m_oleinits == 0) { return; } /* Must always decrement count and set since compobj may still be init'd */ etask.m_oleinits--; thkVerify(SetEtask(htask, etask)); /* if not last uninit, now return */ if (etask.m_oleinits != 0) { return; } /* After this point, the uninit should not fail (because we don't have code to redo the init). */ CallObjectInWOW(THK_API_METHOD(THK_API_OleUninitialize), NULL ); CoUninitialize(); } //+--------------------------------------------------------------------------- // // Function: ReadClassStm, Split // // Synopsis: // // Effects: // // Arguments: [pStm] -- // [pclsid] -- // // Requires: // // Returns: // // Signals: // // Modifies: // // Algorithm: // // History: 2-28-94 kevinro Created // // Notes: // //---------------------------------------------------------------------------- STDAPI ReadClassStm(LPSTREAM pStm, CLSID FAR* pclsid) { return (HRESULT)CallObjectInWOW(THK_API_METHOD(THK_API_ReadClassStm), PASCAL_STACK_PTR(pStm) ); } //+--------------------------------------------------------------------------- // // Function: WriteClassStm, Split // // Synopsis: // // Effects: // // Arguments: [pStm] -- // [rclsid] -- // // Requires: // // Returns: // // Signals: // // Modifies: // // Algorithm: // // History: 2-28-94 kevinro Created // // Notes: // //---------------------------------------------------------------------------- STDAPI WriteClassStm(LPSTREAM pStm, REFCLSID rclsid) { return (HRESULT)CallObjectInWOW(THK_API_METHOD(THK_API_WriteClassStm) , PASCAL_STACK_PTR(pStm) ); }
<filename>dygiepp/dygie/models/events.py<gh_stars>10-100 import logging from os import path import itertools from typing import Any, Dict, List, Optional import torch from torch.nn import functional as F from overrides import overrides from allennlp.data import Vocabulary from allennlp.models.model import Model from allennlp.modules import FeedForward, Seq2SeqEncoder from allennlp.nn import util, InitializerApplicator, RegularizerApplicator from allennlp.modules import TimeDistributed from allennlp.modules.token_embedders import Embedding from allennlp.modules.matrix_attention.bilinear_matrix_attention import BilinearMatrixAttention from dygie.training.relation_metrics import RelationMetrics, CandidateRecall from dygie.training.event_metrics import EventMetrics, ArgumentStats from dygie.models.shared import fields_to_batches from dygie.models.one_hot import make_embedder from dygie.models.entity_beam_pruner import make_pruner from dygie.models.span_prop import SpanProp # TODO(dwadden) rename NERMetrics logger = logging.getLogger(__name__) # pylint: disable=invalid-name # TODO(dwadden) add tensor dimension comments. # TODO(dwadden) Different sentences should have different number of relation candidates depending on # length. class EventExtractor(Model): """ Event extraction for DyGIE. """ # TODO(dwadden) add option to make `mention_feedforward` be the NER tagger. def __init__(self, vocab: Vocabulary, trigger_feedforward: FeedForward, trigger_candidate_feedforward: FeedForward, mention_feedforward: FeedForward, # Used if entity beam is off. argument_feedforward: FeedForward, context_attention: BilinearMatrixAttention, trigger_attention: Seq2SeqEncoder, span_prop: SpanProp, cls_projection: FeedForward, feature_size: int, trigger_spans_per_word: float, argument_spans_per_word: float, loss_weights, trigger_attention_context: bool, event_args_use_trigger_labels: bool, event_args_use_ner_labels: bool, event_args_label_emb: int, shared_attention_context: bool, label_embedding_method: str, event_args_label_predictor: str, event_args_gold_candidates: bool = False, # If True, use gold argument candidates. context_window: int = 0, softmax_correction: bool = False, initializer: InitializerApplicator = InitializerApplicator(), positive_label_weight: float = 1.0, entity_beam: bool = False, regularizer: Optional[RegularizerApplicator] = None) -> None: super(EventExtractor, self).__init__(vocab, regularizer) self._n_ner_labels = vocab.get_vocab_size("ner_labels") self._n_trigger_labels = vocab.get_vocab_size("trigger_labels") self._n_argument_labels = vocab.get_vocab_size("argument_labels") # Embeddings for trigger labels and ner labels, to be used by argument scorer. # These will be either one-hot encodings or learned embeddings, depending on "kind". self._ner_label_emb = make_embedder(kind=label_embedding_method, num_embeddings=self._n_ner_labels, embedding_dim=event_args_label_emb) self._trigger_label_emb = make_embedder(kind=label_embedding_method, num_embeddings=self._n_trigger_labels, embedding_dim=event_args_label_emb) self._label_embedding_method = label_embedding_method # Weight on trigger labeling and argument labeling. self._loss_weights = loss_weights # Trigger candidate scorer. null_label = vocab.get_token_index("", "trigger_labels") assert null_label == 0 # If not, the dummy class won't correspond to the null label. self._trigger_scorer = torch.nn.Sequential( TimeDistributed(trigger_feedforward), TimeDistributed(torch.nn.Linear(trigger_feedforward.get_output_dim(), self._n_trigger_labels - 1))) self._trigger_attention_context = trigger_attention_context if self._trigger_attention_context: self._trigger_attention = trigger_attention # Make pruners. If `entity_beam` is true, use NER and trigger scorers to construct the beam # and only keep candidates that the model predicts are actual entities or triggers. self._mention_pruner = make_pruner(mention_feedforward, entity_beam=entity_beam, gold_beam=event_args_gold_candidates) self._trigger_pruner = make_pruner(trigger_candidate_feedforward, entity_beam=entity_beam, gold_beam=False) # Argument scorer. self._event_args_use_trigger_labels = event_args_use_trigger_labels # If True, use trigger labels. self._event_args_use_ner_labels = event_args_use_ner_labels # If True, use ner labels to predict args. assert event_args_label_predictor in ["hard", "softmax", "gold"] # Method for predicting labels at test time. self._event_args_label_predictor = event_args_label_predictor self._event_args_gold_candidates = event_args_gold_candidates # If set to True, then construct a context vector from a bilinear attention over the trigger # / argument pair embeddings and the text. self._context_window = context_window # If greater than 0, concatenate context as features. self._argument_feedforward = argument_feedforward self._argument_scorer = torch.nn.Linear(argument_feedforward.get_output_dim(), self._n_argument_labels) # Distance embeddings. self._num_distance_buckets = 10 # Just use 10 which is the default. self._distance_embedding = Embedding(self._num_distance_buckets, feature_size) # Class token projection. self._cls_projection = cls_projection self._cls_n_triggers = torch.nn.Linear(self._cls_projection.get_output_dim(), 5) self._cls_event_types = torch.nn.Linear(self._cls_projection.get_output_dim(), self._n_trigger_labels - 1) self._trigger_spans_per_word = trigger_spans_per_word self._argument_spans_per_word = argument_spans_per_word # Context attention for event argument scorer. self._shared_attention_context = shared_attention_context if self._shared_attention_context: self._shared_attention_context_module = context_attention # Span propagation object. # TODO(dwadden) initialize with `from_params` instead if this ends up working. self._span_prop = span_prop self._span_prop._trig_arg_embedder = self._compute_trig_arg_embeddings self._span_prop._argument_scorer = self._compute_argument_scores # Softmax correction parameters. self._softmax_correction = softmax_correction self._softmax_log_temp = torch.nn.Parameter( torch.zeros([1, 1, 1, self._n_argument_labels])) self._softmax_log_multiplier = torch.nn.Parameter( torch.zeros([1, 1, 1, self._n_argument_labels])) # TODO(dwadden) Add metrics. self._metrics = EventMetrics() self._argument_stats = ArgumentStats() self._trigger_loss = torch.nn.CrossEntropyLoss(reduction="sum") # TODO(dwadden) add loss weights. self._argument_loss = torch.nn.CrossEntropyLoss(reduction="sum", ignore_index=-1) initializer(self) @overrides def forward(self, # type: ignore trigger_mask, trigger_embeddings, spans, span_mask, span_embeddings, # TODO(dwadden) add type. cls_embeddings, sentence_lengths, output_ner, # Needed if we're using entity beam approach. trigger_labels, argument_labels, ner_labels, metadata: List[Dict[str, Any]] = None) -> Dict[str, torch.Tensor]: """ TODO(dwadden) Write documentation. The trigger embeddings are just the contextualized token embeddings, and the trigger mask is the text mask. For the arguments, we consider all the spans. """ cls_projected = self._cls_projection(cls_embeddings) auxiliary_loss = self._compute_auxiliary_loss(cls_projected, trigger_labels, trigger_mask) ner_scores = output_ner["ner_scores"] predicted_ner = output_ner["predicted_ner"] # Compute trigger scores. trigger_scores = self._compute_trigger_scores(trigger_embeddings, cls_projected, trigger_mask) _, predicted_triggers = trigger_scores.max(-1) # Get trigger candidates for event argument labeling. num_trigs_to_keep = torch.floor( sentence_lengths.float() * self._trigger_spans_per_word).long() num_trigs_to_keep = torch.max(num_trigs_to_keep, torch.ones_like(num_trigs_to_keep)) num_trigs_to_keep = torch.min(num_trigs_to_keep, 15 * torch.ones_like(num_trigs_to_keep)) (top_trig_embeddings, top_trig_mask, top_trig_indices, top_trig_scores, num_trigs_kept) = self._trigger_pruner( trigger_embeddings, trigger_mask, num_trigs_to_keep, trigger_scores) top_trig_mask = top_trig_mask.unsqueeze(-1) # Compute the number of argument spans to keep. num_arg_spans_to_keep = torch.floor( sentence_lengths.float() * self._argument_spans_per_word).long() num_arg_spans_to_keep = torch.max(num_arg_spans_to_keep, torch.ones_like(num_arg_spans_to_keep)) num_arg_spans_to_keep = torch.min(num_arg_spans_to_keep, 30 * torch.ones_like(num_arg_spans_to_keep)) # If we're using gold event arguments, include the gold labels. gold_labels = ner_labels if self._event_args_gold_candidates else None (top_arg_embeddings, top_arg_mask, top_arg_indices, top_arg_scores, num_arg_spans_kept) = self._mention_pruner( span_embeddings, span_mask, num_arg_spans_to_keep, ner_scores, gold_labels) top_arg_mask = top_arg_mask.unsqueeze(-1) top_arg_spans = util.batched_index_select(spans, top_arg_indices) # Collect trigger and ner labels, in case they're included as features to the argument # classifier. # At train time, use the gold labels. At test time, use the labels predicted by the model, # or gold if specified. if self.training or self._event_args_label_predictor == "gold": top_trig_labels = trigger_labels.gather(1, top_trig_indices) top_ner_labels = ner_labels.gather(1, top_arg_indices) else: # Hard predictions. if self._event_args_label_predictor == "hard": top_trig_labels = predicted_triggers.gather(1, top_trig_indices) top_ner_labels = predicted_ner.gather(1, top_arg_indices) # Softmax predictions. else: softmax_triggers = trigger_scores.softmax(dim=-1) top_trig_labels = util.batched_index_select(softmax_triggers, top_trig_indices) softmax_ner = ner_scores.softmax(dim=-1) top_ner_labels = util.batched_index_select(softmax_ner, top_arg_indices) # Make a dict of all arguments that are needed to make trigger / argument pair embeddings. trig_arg_emb_dict = dict(cls_projected=cls_projected, top_trig_labels=top_trig_labels, top_ner_labels=top_ner_labels, top_trig_indices=top_trig_indices, top_arg_spans=top_arg_spans, text_emb=trigger_embeddings, text_mask=trigger_mask) # Run span graph propagation, if asked for if self._span_prop._n_span_prop > 0: top_trig_embeddings, top_arg_embeddings = self._span_prop( top_trig_embeddings, top_arg_embeddings, top_trig_mask, top_arg_mask, top_trig_scores, top_arg_scores, trig_arg_emb_dict) top_trig_indices_repeat = (top_trig_indices.unsqueeze(-1). repeat(1, 1, top_trig_embeddings.size(-1))) updated_trig_embeddings = trigger_embeddings.scatter( 1, top_trig_indices_repeat, top_trig_embeddings) # Recompute the trigger scores. trigger_scores = self._compute_trigger_scores(updated_trig_embeddings, cls_projected, trigger_mask) _, predicted_triggers = trigger_scores.max(-1) trig_arg_embeddings = self._compute_trig_arg_embeddings( top_trig_embeddings, top_arg_embeddings, **trig_arg_emb_dict) argument_scores = self._compute_argument_scores( trig_arg_embeddings, top_trig_scores, top_arg_scores, top_arg_mask) _, predicted_arguments = argument_scores.max(-1) predicted_arguments -= 1 # The null argument has label -1. output_dict = {"top_trigger_indices": top_trig_indices, "top_argument_spans": top_arg_spans, "trigger_scores": trigger_scores, "argument_scores": argument_scores, "predicted_triggers": predicted_triggers, "predicted_arguments": predicted_arguments, "num_triggers_kept": num_trigs_kept, "num_argument_spans_kept": num_arg_spans_kept, "sentence_lengths": sentence_lengths} # Evaluate loss and F1 if labels were provided. if trigger_labels is not None and argument_labels is not None: # Compute the loss for both triggers and arguments. trigger_loss = self._get_trigger_loss(trigger_scores, trigger_labels, trigger_mask) gold_arguments = self._get_pruned_gold_arguments( argument_labels, top_trig_indices, top_arg_indices, top_trig_mask, top_arg_mask) argument_loss = self._get_argument_loss(argument_scores, gold_arguments) # Compute F1. predictions = self.decode(output_dict)["decoded_events"] assert len(predictions) == len(metadata) # Make sure length of predictions is right. self._metrics(predictions, metadata) self._argument_stats(predictions) loss = (self._loss_weights["trigger"] * trigger_loss + self._loss_weights["arguments"] * argument_loss + 0.05 * auxiliary_loss) output_dict["loss"] = loss return output_dict @overrides def decode(self, output_dict): """ Take the output and convert it into a list of dicts. Each entry is a sentence. Each key is a pair of span indices for that sentence, and each value is the relation label on that span pair. """ outputs = fields_to_batches({k: v.detach().cpu() for k, v in output_dict.items()}) res = [] # Collect predictions for each sentence in minibatch. for output in outputs: decoded_trig = self._decode_trigger(output) decoded_args, decoded_args_with_scores = self._decode_arguments(output, decoded_trig) entry = dict(trigger_dict=decoded_trig, argument_dict=decoded_args, argument_dict_with_scores=decoded_args_with_scores) res.append(entry) output_dict["decoded_events"] = res return output_dict @overrides def get_metrics(self, reset: bool = False) -> Dict[str, float]: f1_metrics = self._metrics.get_metric(reset) argument_stats = self._argument_stats.get_metric(reset) res = {} res.update(f1_metrics) res.update(argument_stats) return res def _decode_trigger(self, output): trigger_dict = {} for i in range(output["sentence_lengths"]): trig_label = output["predicted_triggers"][i].item() if trig_label > 0: trigger_dict[i] = self.vocab.get_token_from_index(trig_label, namespace="trigger_labels") return trigger_dict def _decode_arguments(self, output, decoded_trig): argument_dict = {} argument_dict_with_scores = {} for i, j in itertools.product(range(output["num_triggers_kept"]), range(output["num_argument_spans_kept"])): trig_ix = output["top_trigger_indices"][i].item() arg_span = tuple(output["top_argument_spans"][j].tolist()) arg_label = output["predicted_arguments"][i, j].item() # Only include the argument if its putative trigger is predicted as a real trigger. if arg_label >= 0 and trig_ix in decoded_trig: arg_score = output["argument_scores"][i, j, arg_label + 1].item() label_name = self.vocab.get_token_from_index(arg_label, namespace="argument_labels") argument_dict[(trig_ix, arg_span)] = label_name # Keep around a version with the predicted labels and their scores, for debugging # purposes. argument_dict_with_scores[(trig_ix, arg_span)] = (label_name, arg_score) return argument_dict, argument_dict_with_scores def _compute_auxiliary_loss(self, cls_projected, trigger_labels, trigger_mask): num_triggers = ((trigger_labels > 0) * trigger_mask.bool()).sum(dim=1) # Truncate at 4. num_triggers = torch.min(num_triggers, 4 * torch.ones_like(num_triggers)) predicted_num_triggers = self._cls_n_triggers(cls_projected) num_trigger_loss = F.cross_entropy( predicted_num_triggers, num_triggers, weight=torch.tensor([1, 3, 3, 3, 3], device=trigger_labels.device, dtype=torch.float), reduction="sum") label_present = [torch.any(trigger_labels == i, dim=1).unsqueeze(1) for i in range(1, self._n_trigger_labels)] label_present = torch.cat(label_present, dim=1) if cls_projected.device.type != "cpu": label_present = label_present.cuda(cls_projected.device) predicted_event_type_logits = self._cls_event_types(cls_projected) trigger_label_loss = F.binary_cross_entropy_with_logits( predicted_event_type_logits, label_present.float(), reduction="sum") return num_trigger_loss + trigger_label_loss def _compute_trigger_scores(self, trigger_embeddings, cls_projected, trigger_mask): """ Compute trigger scores for all tokens. """ cls_repeat = cls_projected.unsqueeze(dim=1).repeat(1, trigger_embeddings.size(1), 1) trigger_embeddings = torch.cat([trigger_embeddings, cls_repeat], dim=-1) if self._trigger_attention_context: context = self._trigger_attention(trigger_embeddings, trigger_mask) trigger_embeddings = torch.cat([trigger_embeddings, context], dim=2) trigger_scores = self._trigger_scorer(trigger_embeddings) # Give large negative scores to masked-out elements. mask = trigger_mask.unsqueeze(-1) trigger_scores = util.replace_masked_values(trigger_scores, mask, -1e20) dummy_dims = [trigger_scores.size(0), trigger_scores.size(1), 1] dummy_scores = trigger_scores.new_zeros(*dummy_dims) trigger_scores = torch.cat((dummy_scores, trigger_scores), -1) # Give large negative scores to the masked-out values. return trigger_scores def _compute_trig_arg_embeddings(self, top_trig_embeddings, top_arg_embeddings, cls_projected, top_trig_labels, top_ner_labels, top_trig_indices, top_arg_spans, text_emb, text_mask): """ Create trigger / argument pair embeddings, consisting of: - The embeddings of the trigger and argument pair. - Optionally, the embeddings of the trigger and argument labels. - Optionally, embeddings of the words surrounding the trigger and argument. """ trig_emb_extras = [] arg_emb_extras = [] if self._context_window > 0: # Include words in a window around trigger and argument. # For triggers, the span start and end indices are the same. trigger_context = self._get_context(top_trig_indices, top_trig_indices, text_emb) argument_context = self._get_context( top_arg_spans[:, :, 0], top_arg_spans[:, :, 1], text_emb) trig_emb_extras.append(trigger_context) arg_emb_extras.append(argument_context) # TODO(dwadden) refactor this. Way too many conditionals. if self._event_args_use_trigger_labels: if self._event_args_label_predictor == "softmax" and not self.training: if self._label_embedding_method == "one_hot": # If we're using one-hot encoding, just return the scores for each class. top_trig_embs = top_trig_labels else: # Otherwise take the average of the embeddings, weighted by softmax scores. top_trig_embs = torch.matmul(top_trig_labels, self._trigger_label_emb.weight) trig_emb_extras.append(top_trig_embs) else: trig_emb_extras.append(self._trigger_label_emb(top_trig_labels)) if self._event_args_use_ner_labels: if self._event_args_label_predictor == "softmax" and not self.training: # Same deal as for trigger labels. if self._label_embedding_method == "one_hot": top_ner_embs = top_ner_labels else: top_ner_embs = torch.matmul(top_ner_labels, self._ner_label_emb.weight) arg_emb_extras.append(top_ner_embs) else: # Otherwise, just return the embeddings. arg_emb_extras.append(self._ner_label_emb(top_ner_labels)) num_trigs = top_trig_embeddings.size(1) num_args = top_arg_embeddings.size(1) trig_emb_expanded = top_trig_embeddings.unsqueeze(2) trig_emb_tiled = trig_emb_expanded.repeat(1, 1, num_args, 1) arg_emb_expanded = top_arg_embeddings.unsqueeze(1) arg_emb_tiled = arg_emb_expanded.repeat(1, num_trigs, 1, 1) distance_embeddings = self._compute_distance_embeddings(top_trig_indices, top_arg_spans) cls_repeat = (cls_projected.unsqueeze(dim=1).unsqueeze(dim=2). repeat(1, num_trigs, num_args, 1)) pair_embeddings_list = [trig_emb_tiled, arg_emb_tiled, distance_embeddings, cls_repeat] pair_embeddings = torch.cat(pair_embeddings_list, dim=3) if trig_emb_extras: trig_extras_expanded = torch.cat(trig_emb_extras, dim=-1).unsqueeze(2) trig_extras_tiled = trig_extras_expanded.repeat(1, 1, num_args, 1) pair_embeddings = torch.cat([pair_embeddings, trig_extras_tiled], dim=3) if arg_emb_extras: arg_extras_expanded = torch.cat(arg_emb_extras, dim=-1).unsqueeze(1) arg_extras_tiled = arg_extras_expanded.repeat(1, num_trigs, 1, 1) pair_embeddings = torch.cat([pair_embeddings, arg_extras_tiled], dim=3) if self._shared_attention_context: attended_context = self._get_shared_attention_context(pair_embeddings, text_emb, text_mask) pair_embeddings = torch.cat([pair_embeddings, attended_context], dim=3) return pair_embeddings def _compute_distance_embeddings(self, top_trig_indices, top_arg_spans): top_trig_ixs = top_trig_indices.unsqueeze(2) arg_span_starts = top_arg_spans[:, :, 0].unsqueeze(1) arg_span_ends = top_arg_spans[:, :, 1].unsqueeze(1) dist_from_start = top_trig_ixs - arg_span_starts dist_from_end = top_trig_ixs - arg_span_ends # Distance from trigger to arg. dist = torch.min(dist_from_start.abs(), dist_from_end.abs()) # When the trigger is inside the arg span, also set the distance to zero. trigger_inside = (top_trig_ixs >= arg_span_starts) & (top_trig_ixs <= arg_span_ends) dist[trigger_inside] = 0 dist_buckets = util.bucket_values(dist, self._num_distance_buckets) dist_emb = self._distance_embedding(dist_buckets) trigger_before_feature = (top_trig_ixs < arg_span_starts).float().unsqueeze(-1) trigger_inside_feature = trigger_inside.float().unsqueeze(-1) res = torch.cat([dist_emb, trigger_before_feature, trigger_inside_feature], dim=-1) return res def _get_shared_attention_context(self, pair_embeddings, text_emb, text_mask): batch_size, n_triggers, n_args, emb_dim = pair_embeddings.size() pair_emb_flat = pair_embeddings.view([batch_size, -1, emb_dim]) attn_unnorm = self._shared_attention_context_module(pair_emb_flat, text_emb) attn_weights = util.masked_softmax(attn_unnorm, text_mask) context = util.weighted_sum(text_emb, attn_weights) context = context.view(batch_size, n_triggers, n_args, -1) return context def _get_context(self, span_starts, span_ends, text_emb): """ Given span start and end (inclusive), get the context on either side. """ # The text_emb are already zero-padded on the right, which is correct. assert span_starts.size() == span_ends.size() batch_size, seq_length, emb_size = text_emb.size() num_candidates = span_starts.size(1) padding = torch.zeros(batch_size, self._context_window, emb_size, device=text_emb.device) # [batch_size, seq_length + 2 x context_window, emb_size] padded_emb = torch.cat([padding, text_emb, padding], dim=1) pad_batch = [] for batch_ix, (start_ixs, end_ixs) in enumerate(zip(span_starts, span_ends)): pad_entry = [] for start_ix, end_ix in zip(start_ixs, end_ixs): # The starts are inclusive, ends are exclusive. left_start = start_ix left_end = start_ix + self._context_window right_start = end_ix + self._context_window + 1 right_end = end_ix + 2 * self._context_window + 1 left_pad = padded_emb[batch_ix, left_start:left_end] right_pad = padded_emb[batch_ix, right_start:right_end] pad = torch.cat([left_pad, right_pad], dim=0).view(-1).unsqueeze(0) pad_entry.append(pad) pad_entry = torch.cat(pad_entry, dim=0).unsqueeze(0) pad_batch.append(pad_entry) pad_batch = torch.cat(pad_batch, dim=0) return pad_batch def _compute_argument_scores(self, pairwise_embeddings, top_trig_scores, top_arg_scores, top_arg_mask, prepend_zeros=True): batch_size = pairwise_embeddings.size(0) max_num_trigs = pairwise_embeddings.size(1) max_num_args = pairwise_embeddings.size(2) feature_dim = self._argument_feedforward.input_dim embeddings_flat = pairwise_embeddings.view(-1, feature_dim) arguments_projected_flat = self._argument_feedforward(embeddings_flat) argument_scores_flat = self._argument_scorer(arguments_projected_flat) argument_scores = argument_scores_flat.view(batch_size, max_num_trigs, max_num_args, -1) # Add the mention scores for each of the candidates. argument_scores += (top_trig_scores.unsqueeze(-1) + top_arg_scores.transpose(1, 2).unsqueeze(-1)) # Softmax correction to compare arguments. if self._softmax_correction: the_temp = torch.exp(self._softmax_log_temp) the_multiplier = torch.exp(self._softmax_log_multiplier) softmax_scores = util.masked_softmax(argument_scores / the_temp, mask=top_arg_mask, dim=2) argument_scores = argument_scores + the_multiplier * softmax_scores shape = [argument_scores.size(0), argument_scores.size(1), argument_scores.size(2), 1] dummy_scores = argument_scores.new_zeros(*shape) if prepend_zeros: argument_scores = torch.cat([dummy_scores, argument_scores], -1) return argument_scores @staticmethod def _get_pruned_gold_arguments(argument_labels, top_trig_indices, top_arg_indices, top_trig_masks, top_arg_masks): """ Loop over each slice and get the labels for the spans from that slice. All labels are offset by 1 so that the "null" label gets class zero. This is the desired behavior for the softmax. Labels corresponding to masked relations keep the label -1, which the softmax loss ignores. """ arguments = [] zipped = zip(argument_labels, top_trig_indices, top_arg_indices, top_trig_masks.bool(), top_arg_masks.bool()) for sliced, trig_ixs, arg_ixs, trig_mask, arg_mask in zipped: entry = sliced[trig_ixs][:, arg_ixs].unsqueeze(0) mask_entry = trig_mask & arg_mask.transpose(0, 1).unsqueeze(0) entry[mask_entry] += 1 entry[~mask_entry] = -1 arguments.append(entry) return torch.cat(arguments, dim=0) def _get_trigger_loss(self, trigger_scores, trigger_labels, trigger_mask): trigger_scores_flat = trigger_scores.view(-1, self._n_trigger_labels) trigger_labels_flat = trigger_labels.view(-1) mask_flat = trigger_mask.view(-1).bool() loss = self._trigger_loss(trigger_scores_flat[mask_flat], trigger_labels_flat[mask_flat]) return loss def _get_argument_loss(self, argument_scores, argument_labels): """ Compute cross-entropy loss on argument labels. """ # Need to add one for the null class. scores_flat = argument_scores.view(-1, self._n_argument_labels + 1) # Need to add 1 so that the null label is 0, to line up with indices into prediction matrix. labels_flat = argument_labels.view(-1) # Compute cross-entropy loss. loss = self._argument_loss(scores_flat, labels_flat) return loss
from random import random from random import choice import numpy as np import plotly.express as px import struct import operator ### # Broadly the same as "basic_functions.py" but updated to include motility # intentionally trying to keep them separate so as not to slow down the basic version ### class MotilityParameters: def __init__(self, switch_to_m_rate, switch_to_p_rate, motility_rate): # 0 motility state is proliferating, 1 is moving self.m = switch_to_m_rate self.p = switch_to_p_rate self.rate = motility_rate self.dict = {0: switch_to_m_rate, 1: switch_to_p_rate + motility_rate} class ParametersBasic: def __init__(self, s_division_rate, epsilon, p_division_rate, apoptosis_rate): self.s = s_division_rate self.p = p_division_rate self.e = epsilon self.a = apoptosis_rate self.dict = {0: s_division_rate, 1: p_division_rate, 2: apoptosis_rate} self.death = {0: 0, 1: 0, 2: apoptosis_rate} class ParametersQuiescent: def __init__(self, k1, k2, k3, k4, k5, k6, k7, k8): # s>s+s :k1, s>s+p:k2, s>dead:k3, p>p+p:k4, p>dead:k5, p>Q:k6, D>dead:k7, Q>s:k8 self.k1 = k1 self.k2 = k2 self.k3 = k3 self.k4 = k4 self.k5 = k5 self.k6 = k6 self.k7 = k7 self.k8 = k8 # rate of something happening for each state # note the slight change in notation, 0 is stem cell, 1 progenitor, 2 differentiated and 3 quiescent self.dict = {0: k1+k2+k3, 1: k4+k5+k6, 2: k7, 3: k8} self.death = {0: k3, 1: k5, 2: k7, 3: 0} def cancer_seed_single(cells, switch_3d): # created initial cancer stem cell at [0,0] if switch_3d: cells.update({(0, 0, 0): [0, 0, 0]}) else: cells.update({(0,0): [0, 0, 0]}) def cancer_seed_single_quiescent(cells): # created initial cancer cell (differentiated) at [0,0] cells.update({(0,0): [3, 0, 0]}) def cancer_seed_single_progen(cells): # created initial cancer cell (differentiated) at [0,0] cells.update({(0,0): [1, 0, 0]}) def timing_update_all(cells, params, mot_params): # update second entry in dict to give a timing based on the first entry, the state # time is log(1/rand_no)/rate # Now want to account for fact that cells can either change motility state or move or divide # options: # motility state 1: can either move, change motility state, or die # motility state 0: can either change motility state or go though all division choices # including death (already written) for k in cells.keys(): state = cells.get(k)[0] mot = cells.get(k)[2] div = params.dict[state] # division or death rate for motility 0 m_or_c = mot_params.dict[mot] # move or change rate mot_death = params.death[state] # death rate for motility state 1 if mot == 0: rate = div+m_or_c else: rate = m_or_c + mot_death cells.update({k: [state, np.log(1/random())/rate, mot]}) def choose_new_pos(pos, cells): # Identifies a free position for a cell to divide or move into. In this function a 2d square grid is used # space is searched for in the surrounding area, by random number generator, if there is already a cell # occupying the space then that space is excluded from possible locations and a new random number is generated. i = pos[0] j = pos[1] neighbours = [(i+1, j), (i-1, j), (i, j-1), (i, j+1)] options = [0, 1, 2, 3] cont = 0 new_pos = 0 while cont == 0 and len(options) > 0: pick = choice(options) check = neighbours[pick] if check in cells: options.remove(pick) else: cont = 1 new_pos = check return new_pos def choose_new_pos_eq(pos, cells): # choses a new position by identifying all the free spaces first and then assigning them all equal probability i = pos[0] j = pos[1] neighbours = [(i+1, j), (i-1, j), (i, j-1), (i, j+1)] options = [0, 1, 2, 3] for n in range(len(neighbours)): if neighbours[n] in cells: options.remove(n) if len(options) > 0: new_pos = neighbours[choice(options)] else: new_pos = 0 return new_pos def choose_new_pos_3d(pos, cells): # 3d version of "choose_new_pos", the same method is used i = pos[0] j = pos[1] k = pos[2] # this currently assumes only square transitions on the cubic grid, may want to alter neighbours = [(i + 1, j, k), (i - 1, j, k), (i, j + 1, k), (i, j - 1, k), (i, j, k + 1), (i, j, k - 1)] options = [0, 1, 2, 3, 4, 5] cont = 0 new_pos = 0 while cont == 0 and len(options) > 0: pick = choice(options) check = neighbours[pick] if check in cells: options.remove(pick) else: cont = 1 new_pos = check return new_pos def choose_new_pos_3d_eq(pos, cells): # 3d version of "choose_new_pos", the same method is used i = pos[0] j = pos[1] k = pos[2] # this currently assumes only square transitions on the cubic grid, may want to alter neighbours = [(i + 1, j, k), (i - 1, j, k), (i, j + 1, k), (i, j - 1, k), (i, j, k + 1), (i, j, k - 1)] options = [0, 1, 2, 3, 4, 5] cont = 0 new_pos = 0 while cont == 0 and len(options) > 0: pick = choice(options) check = neighbours[pick] if check in cells: options.remove(pick) else: cont = 1 new_pos = check return new_pos def move_cell(cells, pos, state, switch_3d): # moves the cell if switch_3d: new_location = choose_new_pos_3d(pos, cells) else: new_location = choose_new_pos(pos, cells) if new_location != 0: del cells[pos] cells.update({new_location: [state, 0, 1]}) def update_cell_basic(cells, pos, params, switch_3d, mot_params): # updates a given cell based on the current state of that cell # pos is string describing position # time is from random number generator giving time of interaction # cells is dict describing all cells in the tumour state = cells.get(pos)[0] mot = cells.get(pos)[2] # Once motility is included first thing is to make a decision on whether the cell moves, divides, or switches # to a different motility state. Need to check that an appropriate time step is being used still. mot_check = random() if mot == 1: # Can move, cell can either switch motility state or move or die if mot_check < mot_params.p/(mot_params.dict.get(mot) + params.death.get(state)): # then the motilty state changes cells.update({pos: [state, 0, abs(mot-1)]}) elif mot_check < mot_params.dict.get(mot)/(mot_params.dict.get(mot) + params.death.get(state)): # The cell moves move_cell(cells, pos, state, switch_3d) else: # cell death del cells[pos] else: # No motility, can either switch state or go to division decisions if mot_check < mot_params.m/(mot_params.dict.get(mot) + params.dict.get(state)): # then the motilty state changes cells.update({pos: [state, 0, abs(mot - 1)]}) # The cell divides or dies, can ust move on to that section as we have already conditioned on the # probability of it happening else: if switch_3d: daughter = choose_new_pos_3d(pos, cells) else: daughter = choose_new_pos(pos, cells) if state == 0: # if it's a stem cell there are 2 possibilities, S > S + S, S > S + P # generate random number to determine fate, compare to epsilon r_num = random() if r_num < params.e: # divide > S + S if daughter != 0: cells.update({daughter: [0, 0, 0]}) else: # divide > S + P if daughter != 0: cells.update({daughter: [1, 0, 0]}) elif state == 1: # if it's a progentior cell there are 2 possibilities, P > P + P, P > D # generate random number to determine fate, start by assuming each happens with equal chance r_num = random() if r_num < 0.5: # P > P + P if daughter != 0: cells.update({daughter: [1, 0, 0]}) else: # P > D cells.update({pos: [2, 0, 0]}) else: # If it is differentiated cell the only possible state change is death del cells[pos] def update_cell_quiescent(cells, pos, params, switch_3d, mot_params): # updates a given cell based on the current state of that cell # pos is string describing position # time is from random number generator giving time of interaction # cells is dict describing all cells in the tumour state = cells.get(pos)[0] mot = cells.get(pos)[2] # Once motility is included first thing is to make a decision on whether the cell moves, divides, or switches # to a different motility state. Need to check that an appropriate time step is being used still. mot_check = random() if mot == 1: # Can move, cell can either switch motility state or move or die if mot_check < mot_params.p / (mot_params.dict.get(mot) + params.death.get(state)): # then the motilty state changes cells.update({pos: [state, 0, abs(mot - 1)]}) elif mot_check < mot_params.dict.get(mot) / (mot_params.dict.get(mot) + params.death.get(state)): # The cell moves move_cell(cells, pos, state, switch_3d) else: # cell death del cells[pos] else: # No motility, can either switch state or go to division decisions if mot_check < mot_params.m / (mot_params.dict.get(mot) + params.dict.get(state)): # then the motilty state changes cells.update({pos: [state, 0, abs(mot - 1)]}) else: if switch_3d: daughter = choose_new_pos_3d(pos, cells) else: daughter = choose_new_pos(pos, cells) if state == 0: # if it's a stem cell there are 3 possibilities, S > S + S, S > S + P and S > dead # generate random number to determine fate r_num = random() if r_num < params.k1/params.dict.get(0): # divide > S + S if daughter != 0: cells.update({daughter: [0, 0, 0]}) elif r_num < (params.k1+params.k2)/params.dict.get(0): # divide > S + P if daughter != 0: cells.update({daughter: [1, 0, 0]}) else: # die del cells[pos] elif state == 1: # if it's a progentior cell there are 3 possibilities, P > P + P, P > D, P > Q # generate random number to determine fate r_num = random() if r_num < params.k4/params.dict.get(1): # P > P + P if daughter != 0: cells.update({daughter: [1, 0, 0]}) elif r_num < (params.k4+params.k5)/params.dict.get(1): # P > D cells.update({pos: [2, 0, 0]}) else: # P > Q cells.update({pos: [3, 0, 0]}) elif state == 2: # If it is differentiated cell the only possible state change is death del cells[pos] else: # If its Quiescent the only possible fate is to return to a stem cell cells.update({pos: [0, 0, 0]}) def animate(animation_df, r, name): # animate the simulations using plotly and save as a .html animation_df['coord'] = animation_df[['x', 'y']].values.tolist() animation_df['coord'] = animation_df['coord'].apply(lambda x: np.array(x)) #print(animation_df) if len(animation_df['coord'].values[0]) > 2: print("currently cannot animate for 3d") raise ValueError() mapping = {0: 'stem cell', 1: 'progenitor cell', 2: 'differentiated cell', 3: 'quiescent cell'} animation_df = animation_df.replace({'state': mapping}) animation_df = animation_df.append( {'state': 'differentiated cell', 'count': 0, 'coord': 0, 'x': 10000, 'y': 10000}, ignore_index=True) animation_df = animation_df.append( {'state': 'progenitor cell', 'count': 0, 'coord': 0, 'x': 10000, 'y': 10000}, ignore_index=True) animation_df = animation_df.append( {'state': 'quiescent cell', 'count': 0, 'coord': 0, 'x': 10000, 'y': 10000}, ignore_index=True) fig = px.scatter(animation_df, x="x", y="y", animation_frame="count", color='state', size_max=55, range_x=[-50, 50], range_y=[-50, 50]) fig.update_traces(marker=dict(size=12)) fig.layout.updatemenus[0].buttons[0].args[1]["frame"]["duration"] = 20 fig.show() fig.write_html(name + '/ani_' + str(r) + '.html') def read_from_file(file_name, switch_3d): # read data from binary file in the form: time step, x, y, state, motility if switch_3d: struct_fmt = '=iiiiii' # 6 ints else: struct_fmt = '=iiiii' # 5 ints struct_len = struct.calcsize(struct_fmt) struct_unpack = struct.Struct(struct_fmt).unpack_from results = [] with open(file_name, "rb") as f: while True: data = f.read(struct_len) if not data: break s = struct_unpack(data) results.append(s) return results def calculate_timestep(params, mot_params): # calculates timestep based on the probability of 2 or more events happening in a timestep (<0.01) max_rate = max(params.dict.items(), key=operator.itemgetter(1))[1] + \ max(mot_params.dict.items(), key=operator.itemgetter(1))[1] # playing it safe by summing max of each lambert = 0.135157 step = lambert/max_rate print('exact timestep from calculation', step) if step > 0.1: return step // 0.1 * 0.1 elif step > 0.01: return step // 0.01 * 0.01 else: return step // 0.001 * 0.001
package update import ( "fmt" "gopkg.in/yaml.v2" "github.com/jenkins-x/jx-logging/pkg/log" "github.com/hashicorp/go-version" "github.com/plumming/dx/pkg/api" "io/ioutil" "time" ) // ReleaseInfo stores information about a release. type ReleaseInfo struct { Version string `json:"tag_name"` URL string `json:"html_url"` } type StateEntry struct { CheckedForUpdateAt time.Time `yaml:"checked_for_update_at"` LatestRelease ReleaseInfo `yaml:"latest_release"` } // CheckForUpdate checks whether this software has had a newer release on GitHub. func CheckForUpdate(client *api.Client, stateFilePath, repo, currentVersion string) (*ReleaseInfo, error) { log.Logger().Debugf("checking for update - current version: %s", currentVersion) latestRelease, err := GetLatestReleaseInfo(client, stateFilePath, repo, false) if err != nil { return nil, err } log.Logger().Debugf("latest release is %s", latestRelease) if versionGreaterThan(latestRelease.Version, currentVersion) { return latestRelease, nil } return nil, nil } func GetLatestReleaseInfo(client *api.Client, stateFilePath, repo string, force bool) (*ReleaseInfo, error) { if !force { stateEntry, err := getStateEntry(stateFilePath) if err == nil && time.Since(stateEntry.CheckedForUpdateAt).Hours() < 24 { return &stateEntry.LatestRelease, nil } } var latestRelease ReleaseInfo err := client.REST("github.com", "GET", fmt.Sprintf("repos/%s/releases/latest", repo), nil, &latestRelease) if err != nil { return nil, err } err = setStateEntry(stateFilePath, time.Now(), latestRelease) if err != nil { return nil, err } return &latestRelease, nil } func getStateEntry(stateFilePath string) (*StateEntry, error) { content, err := ioutil.ReadFile(stateFilePath) if err != nil { return nil, err } var stateEntry StateEntry err = yaml.Unmarshal(content, &stateEntry) if err != nil { return nil, err } return &stateEntry, nil } func setStateEntry(stateFilePath string, t time.Time, r ReleaseInfo) error { data := StateEntry{CheckedForUpdateAt: t, LatestRelease: r} content, err := yaml.Marshal(data) if err != nil { return err } _ = ioutil.WriteFile(stateFilePath, content, 0600) return nil } func versionGreaterThan(v, w string) bool { log.Logger().Debugf("checking if %s is greater than %s", v, w) vv, ve := version.NewVersion(v) vw, we := version.NewVersion(w) log.Logger().Debugf("checking if %s is greater than %s - parsed", vv, vw) return ve == nil && we == nil && vv.GreaterThan(vw) }
def _set_view_data(self, object_content): logger.info("Setting view data for a %s", self.__class__) self._object_content = object_content for dynprop in object_content.propSet: if dynprop.name not in self._valid_attrs: logger.error("Server returned a property '%s' but the object" " hasn't defined it so it is being ignored." % dynprop.name) continue try: if not len(dynprop.val): logger.info("Server returned empty value for %s", dynprop.name) except TypeError: logger.info("%s of type %s has no len!", dynprop.name, type(dynprop.val)) pass try: cache = self._cache except AttributeError: cache = self._cache = {} if dynprop.val.__class__.__name__.startswith('Array'): logger.info("Setting value of an Array* property") logger.debug("%s being set to %s", dynprop.name, dynprop.val[0]) now = time.time() cache[dynprop.name] = (dynprop.val[0], now) else: logger.info("Setting value of a single-valued property") logger.debug("DynamicProperty value is a %s: ", dynprop.val.__class__.__name__) logger.debug("%s being set to %s", dynprop.name, dynprop.val) now = time.time() cache[dynprop.name] = (dynprop.val, now)
//======================================================================= // Copyright 1997, 1998, 1999, 2000 University of Notre Dame. // Copyright 2004, 2005 Trustees of Indiana University // Authors: Andrew Lumsdaine, Lie-Quan Lee, Jeremy G. Siek, // Doug Gregor, D. Kevin McGrath // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) //======================================================================= #ifndef BOOST_GRAPH_CUTHILL_MCKEE_HPP #define BOOST_GRAPH_CUTHILL_MCKEE_HPP #include <boost/config.hpp> #include <boost/graph/detail/sparse_ordering.hpp> #include <boost/graph/graph_utility.hpp> #include <algorithm> /* (Reverse) Cuthill-McKee Algorithm for matrix reordering */ namespace boost { namespace detail { template < typename OutputIterator, typename Buffer, typename DegreeMap > class bfs_rcm_visitor:public default_bfs_visitor { public: bfs_rcm_visitor(OutputIterator *iter, Buffer *b, DegreeMap deg): permutation(iter), Qptr(b), degree(deg) { } template <class Vertex, class Graph> void examine_vertex(Vertex u, Graph&) { *(*permutation)++ = u; index_begin = Qptr->size(); } template <class Vertex, class Graph> void finish_vertex(Vertex, Graph&) { using std::sort; typedef typename property_traits<DegreeMap>::value_type ds_type; typedef indirect_cmp<DegreeMap, std::less<ds_type> > Compare; Compare comp(degree); sort(Qptr->begin()+index_begin, Qptr->end(), comp); } protected: OutputIterator *permutation; int index_begin; Buffer *Qptr; DegreeMap degree; }; } // namespace detail // Reverse Cuthill-McKee algorithm with a given starting Vertex. // // If user provides a reverse iterator, this will be a reverse-cuthill-mckee // algorithm, otherwise it will be a standard CM algorithm template <class Graph, class OutputIterator, class ColorMap, class DegreeMap> OutputIterator cuthill_mckee_ordering(const Graph& g, std::deque< typename graph_traits<Graph>::vertex_descriptor > vertex_queue, OutputIterator permutation, ColorMap color, DegreeMap degree) { //create queue, visitor...don't forget namespaces! typedef typename graph_traits<Graph>::vertex_descriptor Vertex; typedef typename boost::sparse::sparse_ordering_queue<Vertex> queue; typedef typename detail::bfs_rcm_visitor<OutputIterator, queue, DegreeMap> Visitor; typedef typename property_traits<ColorMap>::value_type ColorValue; typedef color_traits<ColorValue> Color; queue Q; //create a bfs_rcm_visitor as defined above Visitor vis(&permutation, &Q, degree); typename graph_traits<Graph>::vertex_iterator ui, ui_end; // Copy degree to pseudo_degree // initialize the color map for (boost::tie(ui, ui_end) = vertices(g); ui != ui_end; ++ui){ put(color, *ui, Color::white()); } while( !vertex_queue.empty() ) { Vertex s = vertex_queue.front(); vertex_queue.pop_front(); //call BFS with visitor breadth_first_visit(g, s, Q, vis, color); } return permutation; } // This is the case where only a single starting vertex is supplied. template <class Graph, class OutputIterator, class ColorMap, class DegreeMap> OutputIterator cuthill_mckee_ordering(const Graph& g, typename graph_traits<Graph>::vertex_descriptor s, OutputIterator permutation, ColorMap color, DegreeMap degree) { std::deque< typename graph_traits<Graph>::vertex_descriptor > vertex_queue; vertex_queue.push_front( s ); return cuthill_mckee_ordering(g, vertex_queue, permutation, color, degree); } // This is the version of CM which selects its own starting vertex template < class Graph, class OutputIterator, class ColorMap, class DegreeMap> OutputIterator cuthill_mckee_ordering(const Graph& G, OutputIterator permutation, ColorMap color, DegreeMap degree) { if (boost::graph::has_no_vertices(G)) return permutation; typedef typename boost::graph_traits<Graph>::vertex_descriptor Vertex; typedef typename property_traits<ColorMap>::value_type ColorValue; typedef color_traits<ColorValue> Color; std::deque<Vertex> vertex_queue; // Mark everything white BGL_FORALL_VERTICES_T(v, G, Graph) put(color, v, Color::white()); // Find one vertex from each connected component BGL_FORALL_VERTICES_T(v, G, Graph) { if (get(color, v) == Color::white()) { depth_first_visit(G, v, dfs_visitor<>(), color); vertex_queue.push_back(v); } } // Find starting nodes for all vertices // TBD: How to do this with a directed graph? for (typename std::deque<Vertex>::iterator i = vertex_queue.begin(); i != vertex_queue.end(); ++i) *i = find_starting_node(G, *i, color, degree); return cuthill_mckee_ordering(G, vertex_queue, permutation, color, degree); } template<typename Graph, typename OutputIterator, typename VertexIndexMap> OutputIterator cuthill_mckee_ordering(const Graph& G, OutputIterator permutation, VertexIndexMap index_map) { if (boost::graph::has_no_vertices(G)) return permutation; std::vector<default_color_type> colors(num_vertices(G)); return cuthill_mckee_ordering(G, permutation, make_iterator_property_map(&colors[0], index_map, colors[0]), make_out_degree_map(G)); } template<typename Graph, typename OutputIterator> inline OutputIterator cuthill_mckee_ordering(const Graph& G, OutputIterator permutation) { return cuthill_mckee_ordering(G, permutation, get(vertex_index, G)); } } // namespace boost #endif // BOOST_GRAPH_CUTHILL_MCKEE_HPP
// Gets the time stamp from the given timer query. uint8 GetTimestamp(ID3D11DeviceContext *context, ID3D11Query *timerQuery) { UINT64 data; while (context->GetData(timerQuery, &data, sizeof(data), 0) == S_FALSE); return data; }
<gh_stars>0 import { html, css, LitElement } from "lit"; export class A2kStack extends LitElement { static styles = css` #stack { display: flex; flex-direction: column; justify-content: flex-start; gap: var(--stack-spacing-top) !important; } `; render() { return html`<div id="stack"> <slot></slot> </div>`; } }
Drinking alcohol while pregnant could become a criminal offence, women's charities have said ahead of a hearing at the Court of Appeal tomorrow. A council is seeking criminal injuries compensation for a six-year-old girl with “growth retardation” caused by her mother's alcohol consumption during pregnancy. If the court rules the woman committed a crime it could pave the way for pregnant women's behaviour to be criminalised, according to the British Pregnancy Advisory Service (bpas) and Birthrights. Join Independent Minds For exclusive articles, events and an advertising-free read for just £5.99 €6.99 $9.99 a month Get the best of The Independent With an Independent Minds subscription for just £5.99 €6.99 $9.99 a month Get the best of The Independent Without the ads – for just £5.99 €6.99 $9.99 a month The little girl was born with Foetal Alcohol Syndrome (FAS), which can cause retarded growth, facial abnormalities and intellectual impairment. Lawyers representing the local authority, in the North West of England, are seeking to prove that the six-year-old's mother committed a crime under the Offences Against the Persons Act 1861. Ann Furedi, chief executive of bpas, and Rebecca Schiller, co-chair of Birthrights, said: "Making one particular form of behaviour during pregnancy into a criminal offence would lay the ground for criminalising a wide range of other behaviours because they may too pose a risk to the health of the baby. "When we consider that the taking of necessary medication, such as treatment for epilepsy or depression, or the refusal of a caesarean section could be seen to fall into the category of maternal behaviours that may damage the foetus, the trajectory of such an approach is deeply worrying. "We should take very seriously any legal developments which call into question pregnant women's fundamental right to bodily autonomy and right to make their own decisions. "Pregnant women deserve support and respect, not the prospect of criminal sanction for behaviour which would not be illegal for anyone else." Foetal Alcohol Syndrome was diagnosed 252 times in England in 2012 to 2013. The charities claim however that there is "continuing uncertainty" in the medical profession over the relationship between drinking and harm to the foetus. They have said mothers and their babies would not be best served by treating pregnant women with drug or alcohol abuse problems as criminals. In January it emerged the authority had failed in its bid to win compensation on the child's behalf from the Criminal Injuries Compensation Authority (CICA). A written ruling by the Upper Tribunal of the Administrative Appeals Chamber said the child was born with foetal alcohol spectrum disorder as a "direct result" of her mother's drinking. But it concluded: "If (the girl) was not a person while her mother was engaging in the relevant actions then... as a matter of law, her mother could not have committed a criminal offence." Neither the girl nor the mother was identified in the ruling. The case will be heard at the Court of Appeal tomorrow with a ruling expected at a later date. Additional reporting by PA
The Vikings’ special teams have been among the best in the NFL the past three years. But a man who played a big role in that will be missing when the regular season kicks off in six weeks. Special-teams coordinator Mike Priefer was suspended by Minnesota last week for the first three games for what an investigation revealed was an antigay remark made in the presence of former punter Chris Kluwe, who had been outspoken in favor of same-sex marriage. The penalty will be cut to two games if Priefer completes sensitivity training. The Vikings will be without Priefer for games Sept. 7 at St. Louis, Sept. 14 at home against New England and, perhaps, Sept. 21 at New Orleans. He is expected to be replaced by special-teams assistant Ryan Ficken, and preparations for games without Priefer obviously will be made when training camp begins Friday. “I think it will be a loss,” fullback Jerome Felton, who plays special teams, said of not having Priefer. “When you look at what he has done the past several years, he definitely is one of the best special-teams coaches in the NFL. So not having his presence on game days will definitely be a loss. But I’m sure he’ll prepare us well; I’m sure another coach will step up. It’s almost like when a player goes down, you’ve got to go to the next man.” Priefer’s reputation as a special-teams ace played a role in coach Mike Zimmer retaining him after Leslie Frazier was fired following last season. Priefer is entering his fourth season with the team. The Vikings last year had the NFL leaders in kickoff-return average (Cordarrelle Patterson, 32.4 yards) and punt-return average (Marcus Sherels, 15.2). The past two seasons saw a streak in which kicker Blair Walsh made an NFL-record 12 consecutive field goals from 50 yards or beyond. Felton pointed out the bulk of key work by a special-teams coordinator is done during the week leading up to the game, so that part won’t hamper the Vikings. As for game days, Ficken, entering his eighth season with the Vikings, is well regarded. “He’s a good coach,” said linebacker Audie Cole, who plays special teams. “I’m sure he’s going to know exactly what coach Priefer wants, so I think we’ll be fine.” Felton has been one of the most outspoken Vikings players in support of Priefer since Kluwe made accusations in a first-person article for Deadspin last January. In the article, Kluwe claimed Priefer made homophobic remarks and that Kluwe was released by the team in May 2013 because of his views on same-sex marriage. The Vikings announced Friday that an investigation revealed Kluwe was let go for football-only reasons and that only one homophobic remark was made by Priefer even though Kluwe has alleged there were at least three. “Obviously, it’s just an unfortunate situation all the way around,” Felton said. “Everybody makes mistakes. I know Priefer to be a good family man, and even if he meant it as a joke, it shouldn’t have been made. But he has a good heart. “I’m glad people don’t record everything I say, because I’ve said stuff that’s maybe offensive to somebody. We’re all accountable for our actions, but I don’t think that’s the type of person (Priefer) is in his heart. I’m glad he’s got an opportunity to make amends.” Priefer has sent out a statement apologizing. He initially denied making the remark in a January statement and in the first of three interviews with investigators before admitting it in the second. “I’m sure it’s going to be tough, but the way he coaches his guys, he coaches all of us to be a coach on special teams,” said linebacker Jasper Brinkley, who played special teams under Priefer for two years before he signed with Arizona for last season and then returned to Minnesota. “It’s going to be tough, but I think we definitely can get it done. We’re going to have to get it done.” Follow Chris Tomasson at twitter.com/christomasson.
<filename>io/router/pointer.go // SPDX-License-Identifier: Unlicense OR MIT package router import ( "encoding/binary" "image" "github.com/cybriq/giocore/f32" "github.com/cybriq/giocore/internal/opconst" "github.com/cybriq/giocore/internal/ops" "github.com/cybriq/giocore/io/event" "github.com/cybriq/giocore/io/pointer" "github.com/cybriq/giocore/op" ) type pointerQueue struct { hitTree []hitNode areas []areaNode cursors []cursorNode cursor pointer.CursorName handlers map[event.Tag]*pointerHandler pointers []pointerInfo reader ops.Reader // states holds the storage for save/restore ops. states []collectState scratch []event.Tag } type hitNode struct { next int area int // Pass tracks the most recent PassOp mode. pass bool // For handler nodes. tag event.Tag } type cursorNode struct { name pointer.CursorName area int } type pointerInfo struct { id pointer.ID pressed bool handlers []event.Tag // last tracks the last pointer event received, // used while processing frame events. last pointer.Event // entered tracks the tags that contain the pointer. entered []event.Tag } type pointerHandler struct { area int active bool wantsGrab bool types pointer.Type // min and max horizontal/vertical scroll scrollRange image.Rectangle } type areaOp struct { kind areaKind rect f32.Rectangle } type areaNode struct { trans f32.Affine2D next int area areaOp } type areaKind uint8 // collectState represents the state for collectHandlers type collectState struct { t f32.Affine2D area int node int pass bool } const ( areaRect areaKind = iota areaEllipse ) func (q *pointerQueue) save(id int, state collectState) { if extra := id - len(q.states) + 1; extra > 0 { q.states = append(q.states, make([]collectState, extra)...) } q.states[id] = state } func (q *pointerQueue) collectHandlers(r *ops.Reader, events *handlerEvents) { state := collectState{ area: -1, node: -1, } q.save(opconst.InitialStateID, state) for encOp, ok := r.Decode(); ok; encOp, ok = r.Decode() { switch opconst.OpType(encOp.Data[0]) { case opconst.TypeSave: id := ops.DecodeSave(encOp.Data) q.save(id, state) case opconst.TypeLoad: id, mask := ops.DecodeLoad(encOp.Data) s := q.states[id] if mask&opconst.TransformState != 0 { state.t = s.t } if mask&^opconst.TransformState != 0 { state = s } case opconst.TypePass: state.pass = encOp.Data[1] != 0 case opconst.TypeArea: var op areaOp op.Decode(encOp.Data) q.areas = append(q.areas, areaNode{trans: state.t, next: state.area, area: op}) state.area = len(q.areas) - 1 q.hitTree = append(q.hitTree, hitNode{ next: state.node, area: state.area, pass: state.pass, }) state.node = len(q.hitTree) - 1 case opconst.TypeTransform: dop := ops.DecodeTransform(encOp.Data) state.t = state.t.Mul(dop) case opconst.TypePointerInput: op := pointer.InputOp{ Tag: encOp.Refs[0].(event.Tag), Grab: encOp.Data[1] != 0, Types: pointer.Type(encOp.Data[2]), } q.hitTree = append(q.hitTree, hitNode{ next: state.node, area: state.area, pass: state.pass, tag: op.Tag, }) state.node = len(q.hitTree) - 1 h, ok := q.handlers[op.Tag] if !ok { h = new(pointerHandler) q.handlers[op.Tag] = h // Cancel handlers on (each) first appearance, but don't // trigger redraw. events.AddNoRedraw(op.Tag, pointer.Event{Type: pointer.Cancel}) } h.active = true h.area = state.area h.wantsGrab = h.wantsGrab || op.Grab h.types = h.types | op.Types bo := binary.LittleEndian.Uint32 h.scrollRange = image.Rectangle{ Min: image.Point{ X: int(int32(bo(encOp.Data[3:]))), Y: int(int32(bo(encOp.Data[7:]))), }, Max: image.Point{ X: int(int32(bo(encOp.Data[11:]))), Y: int(int32(bo(encOp.Data[15:]))), }, } case opconst.TypeCursor: q.cursors = append(q.cursors, cursorNode{ name: encOp.Refs[0].(pointer.CursorName), area: len(q.areas) - 1, }) } } } func (q *pointerQueue) opHit(handlers *[]event.Tag, pos f32.Point) { // Track whether we're passing through hits. pass := true idx := len(q.hitTree) - 1 for idx >= 0 { n := &q.hitTree[idx] if !q.hit(n.area, pos) { idx-- continue } pass = pass && n.pass if pass { idx-- } else { idx = n.next } if n.tag != nil { if _, exists := q.handlers[n.tag]; exists { *handlers = append(*handlers, n.tag) } } } } func (q *pointerQueue) invTransform(areaIdx int, p f32.Point) f32.Point { if areaIdx == -1 { return p } return q.areas[areaIdx].trans.Invert().Transform(p) } func (q *pointerQueue) hit(areaIdx int, p f32.Point) bool { for areaIdx != -1 { a := &q.areas[areaIdx] p := a.trans.Invert().Transform(p) if !a.area.Hit(p) { return false } areaIdx = a.next } return true } func (q *pointerQueue) reset() { if q.handlers == nil { q.handlers = make(map[event.Tag]*pointerHandler) } } func (q *pointerQueue) Frame(root *op.Ops, events *handlerEvents) { q.reset() for _, h := range q.handlers { // Reset handler. h.active = false h.wantsGrab = false h.types = 0 } q.hitTree = q.hitTree[:0] q.areas = q.areas[:0] q.cursors = q.cursors[:0] q.reader.Reset(root) q.collectHandlers(&q.reader, events) for k, h := range q.handlers { if !h.active { q.dropHandlers(events, k) delete(q.handlers, k) } if h.wantsGrab { for _, p := range q.pointers { if !p.pressed { continue } for i, k2 := range p.handlers { if k2 == k { // Drop other handlers that lost their grab. dropped := make([]event.Tag, 0, len(p.handlers)-1) dropped = append(dropped, p.handlers[:i]...) dropped = append(dropped, p.handlers[i+1:]...) cancelHandlers(events, dropped...) q.dropHandlers(events, dropped...) break } } } } } for i := range q.pointers { p := &q.pointers[i] q.deliverEnterLeaveEvents(p, events, p.last) } } func cancelHandlers(events *handlerEvents, tags ...event.Tag) { for _, k := range tags { events.Add(k, pointer.Event{Type: pointer.Cancel}) } } func (q *pointerQueue) dropHandlers(events *handlerEvents, tags ...event.Tag) { for _, k := range tags { for i := range q.pointers { p := &q.pointers[i] for i := len(p.handlers) - 1; i >= 0; i-- { if p.handlers[i] == k { p.handlers = append(p.handlers[:i], p.handlers[i+1:]...) } } for i := len(p.entered) - 1; i >= 0; i-- { if p.entered[i] == k { p.entered = append(p.entered[:i], p.entered[i+1:]...) } } } } } func (q *pointerQueue) Push(e pointer.Event, events *handlerEvents) { q.reset() if e.Type == pointer.Cancel { q.pointers = q.pointers[:0] for k := range q.handlers { cancelHandlers(events, k) q.dropHandlers(events, k) } return } pidx := -1 for i, p := range q.pointers { if p.id == e.PointerID { pidx = i break } } if pidx == -1 { q.pointers = append(q.pointers, pointerInfo{id: e.PointerID}) pidx = len(q.pointers) - 1 } p := &q.pointers[pidx] p.last = e if e.Type == pointer.Move && p.pressed { e.Type = pointer.Drag } if e.Type == pointer.Release { q.deliverEvent(p, events, e) p.pressed = false } q.deliverEnterLeaveEvents(p, events, e) if !p.pressed { p.handlers = append(p.handlers[:0], q.scratch...) } if e.Type == pointer.Press { p.pressed = true } switch e.Type { case pointer.Release: case pointer.Scroll: q.deliverScrollEvent(p, events, e) default: q.deliverEvent(p, events, e) } if !p.pressed && len(p.entered) == 0 { // No longer need to track pointer. q.pointers = append(q.pointers[:pidx], q.pointers[pidx+1:]...) } } func (q *pointerQueue) deliverEvent(p *pointerInfo, events *handlerEvents, e pointer.Event) { foremost := true if p.pressed && len(p.handlers) == 1 { e.Priority = pointer.Grabbed foremost = false } for _, k := range p.handlers { h := q.handlers[k] if e.Type&h.types == 0 { continue } e := e if foremost { foremost = false e.Priority = pointer.Foremost } e.Position = q.invTransform(h.area, e.Position) events.Add(k, e) } } func (q *pointerQueue) deliverScrollEvent(p *pointerInfo, events *handlerEvents, e pointer.Event) { foremost := true if p.pressed && len(p.handlers) == 1 { e.Priority = pointer.Grabbed foremost = false } var sx, sy = e.Scroll.X, e.Scroll.Y for _, k := range p.handlers { if sx == 0 && sy == 0 { return } h := q.handlers[k] // Distribute the scroll to the handler based on its ScrollRange. sx, e.Scroll.X = setScrollEvent(sx, h.scrollRange.Min.X, h.scrollRange.Max.X) sy, e.Scroll.Y = setScrollEvent(sy, h.scrollRange.Min.Y, h.scrollRange.Max.Y) e := e if foremost { foremost = false e.Priority = pointer.Foremost } e.Position = q.invTransform(h.area, e.Position) events.Add(k, e) } } func (q *pointerQueue) deliverEnterLeaveEvents(p *pointerInfo, events *handlerEvents, e pointer.Event) { q.scratch = q.scratch[:0] q.opHit(&q.scratch, e.Position) if p.pressed { // Filter out non-participating handlers. for i := len(q.scratch) - 1; i >= 0; i-- { if _, found := searchTag(p.handlers, q.scratch[i]); !found { q.scratch = append(q.scratch[:i], q.scratch[i+1:]...) } } } hits := q.scratch if e.Source != pointer.Mouse && !p.pressed && e.Type != pointer.Press { // Consider non-mouse pointers leaving when they're released. hits = nil } // Deliver Leave events. for _, k := range p.entered { if _, found := searchTag(hits, k); found { continue } h := q.handlers[k] e.Type = pointer.Leave if e.Type&h.types != 0 { e.Position = q.invTransform(h.area, e.Position) events.Add(k, e) } } // Deliver Enter events and update cursor. q.cursor = pointer.CursorDefault for _, k := range hits { h := q.handlers[k] for i := len(q.cursors) - 1; i >= 0; i-- { if c := q.cursors[i]; c.area == h.area { q.cursor = c.name break } } if _, found := searchTag(p.entered, k); found { continue } e.Type = pointer.Enter if e.Type&h.types != 0 { e.Position = q.invTransform(h.area, e.Position) events.Add(k, e) } } p.entered = append(p.entered[:0], hits...) } func searchTag(tags []event.Tag, tag event.Tag) (int, bool) { for i, t := range tags { if t == tag { return i, true } } return 0, false } func opDecodeFloat32(d []byte) float32 { return float32(int32(binary.LittleEndian.Uint32(d))) } func (op *areaOp) Decode(d []byte) { if opconst.OpType(d[0]) != opconst.TypeArea { panic("invalid op") } rect := f32.Rectangle{ Min: f32.Point{ X: opDecodeFloat32(d[2:]), Y: opDecodeFloat32(d[6:]), }, Max: f32.Point{ X: opDecodeFloat32(d[10:]), Y: opDecodeFloat32(d[14:]), }, } *op = areaOp{ kind: areaKind(d[1]), rect: rect, } } func (op *areaOp) Hit(pos f32.Point) bool { pos = pos.Sub(op.rect.Min) size := op.rect.Size() switch op.kind { case areaRect: return 0 <= pos.X && pos.X < size.X && 0 <= pos.Y && pos.Y < size.Y case areaEllipse: rx := size.X / 2 ry := size.Y / 2 xh := pos.X - rx yk := pos.Y - ry // The ellipse function works in all cases because // 0/0 is not <= 1. return (xh*xh)/(rx*rx)+(yk*yk)/(ry*ry) <= 1 default: panic("invalid area kind") } } func setScrollEvent(scroll float32, min, max int) (left, scrolled float32) { if v := float32(max); scroll > v { return scroll - v, v } if v := float32(min); scroll < v { return scroll - v, v } return 0, scroll }
<gh_stars>1-10 package org.endercore.android.interf; public interface IFileEnvironment { String getCodeCacheDirPath(); String getEnderCoreDirPath(); String getOptionsFilePath(); String getNModsDirPath(); String getNModDirPathFor(String uuid); String getCodeCacheDirPathForDex(); String getCodeCacheDirPathForNativeLib(); String getRedirectedGameDir(); String getCodeCacheDirPathForDexOpt(); String getCodeCacheDirPathForNMods(); String getCodeCacheDirPathForAssets(); }
On Sunday, baseball's regular season came to a close. Although the day's results didn't impact the playoffs, they did alter the 2018 draft order. Because the San Francisco Giants won (on a Pablo Sandoval walk-off home run) and the Detroit Tigers lost, the two teams tied for the worst record in baseball. The Tigers owned the tiebreaker, however, by virtue of having a worse record in 2016. As such, the Tigers will have the first overall pick in the 2018 draft. Here's the full order -- keep in mind, it's in reverse of the standings, with the previous season's won-lost record serving as the tiebreaker: Detroit Tigers San Francisco Giants Philadelphia Phillies Chicago White Sox Cincinnati Reds New York Mets San Diego Padres Atlanta Braves Oakland Athletics Pittsburgh Pirates Baltimore Orioles Toronto Blue Jays Miami Marlins Seattle Mariners Texas Rangers Tampa Bay Rays Los Angeles Angeles Kansas City Royals St. Louis Cardinals Minnesota Twins Milwaukee Brewers Colorado Rockies New York Yankees Chicago Cubs Arizona Diamondbacks Boston Red Sox Washington Nationals Houston Astros Cleveland Indians Los Angeles Dodgers Here are a few other things to know about the Tigers earning the No. 1 pick: Second time Detroit has had the No. 1 pick The Tigers have previously chosen first in the draft just once -- back in 1997, when they picked right-hander Matt Anderson from Rice University. Anderson appeared in 257 big-league games, but finished with a career ERA over 5.00 and was a bust compared to some of the other talent picked in that year's first round -- be it J.D. Drew (who did not sign), Troy Glaus, or even college teammate Lance Berkman. Of course, the Tigers wouldn't mind a repeat of the last time they picked in the top-five of the draft. That was 2004, when they plucked Justin Verlander from Old Dominion University. Verlander, obviously enough, enjoyed one of the best careers in franchise history before being traded to the Houston Astros. The Tigers had not chosen higher than ninth since 2006. Detroit collapsed When we say the Tigers earned the No. 1 pick, we mean they earned the No. 1 pick. Keep in mind, the Tigers were 39-48 entering the second half. From that point forward, the Tigers went 25-40, including a miserable September that saw them go 6-24. Let's repeat that: 6-24 in September; that's good for a 32-win pace over a full season. Brutal. The Giants, by the way, went 29-42 in the second half. The Tigers needed to be every bit as poor as they were late in the year in order to get the top pick. The No. 1 pick candidates With the caveat that these things are fluid and can change quickly, Jim Callis published his 2018 mock draft back in June that listed high school shortstop Brice Turang, college right-hander Brady Singer, and high-school outfielder Jarred Kelenic as the top-three prospects in the upcoming draft. Which of the three will the Tigers take -- if any? We'll find out next June.
/** * Method to use a binary search to find a target string in a * sorted array of strings */ public static String binaryFind(String target, String[] list) { int start = 0; int end = list.length - 1; int checkpoint = 0; while (start <= end) { checkpoint = (int)((start+end)/2.0); System.out.println("Checking at: "+ checkpoint+" start="+start+" end="+end); if (target.compareTo(list[checkpoint]) == 0) { return "Found it!"; } else if (target.compareTo(list[checkpoint]) > 0) { start=checkpoint + 1; } else if (target.compareTo(list[checkpoint]) < 0) { end=checkpoint - 1; } } return "Not found"; }
<gh_stars>10-100 import assert from 'assert'; import { ModelInfoUtil } from '../util/ModelInfoUtil'; import { EggProtoImplClass } from '@eggjs/core-decorator'; export interface AttributeOptions { // field name, default is property name name?: string; // allow null, default is true allowNull?: boolean; // auto increment, default is false autoIncrement?: boolean; // primary field, default is false primary?: boolean; // unique field, default is false unique?: boolean; } export function Attribute(dataType: string, options?: AttributeOptions) { return function(target: any, propertyKey: PropertyKey) { const clazz = target.constructor as EggProtoImplClass; assert(typeof propertyKey === 'string', `[model/${clazz.name}] expect method name be typeof string, but now is ${String(propertyKey)}`); ModelInfoUtil.addModelAttribute(dataType, options, clazz, propertyKey); }; }
def _stable_release(tags): count = 0 release = tags[count] while not release['name'].split('.')[-1].isdigit(): count += 1 release = tags[count] return release
<filename>astropy/cloud/fits/utils.py import numpy as np from astropy.cloud.fits.constants import BLOCK_SIZE from astropy.cloud.fits.datatypes import FITSHeader def as_np_dtype(bitpix: str) -> np.dtype: if bitpix == 8: return np.dtype(np.uint8) elif bitpix == 16: return np.dtype(np.uint16) elif bitpix == 32: return np.dtype(np.uint32) elif bitpix == -32: return np.dtype(np.float32) elif bitpix == -64: return np.dtype(np.float64) raise NotImplementedError(f'BITPIX[{bitpix}] not implemented') def find_next_header_offset(header: FITSHeader) -> int: if header.fits.get('SIMPLE', False) is True: # Primary Header return header.offset + header.length elif header.fits.get('XTENSION', None) in ['IMAGE']: # https://ui.adsabs.harvard.edu/abs/1994A%26AS..105...53P/abstract # http://articles.adsabs.harvard.edu/pdf/1994A%26AS..105...53P B: int = as_np_dtype(header.fits['BITPIX']).itemsize G: int = header.fits['GCOUNT'] P: int = header.fits['PCOUNT'] N: typing.List[int] = [header.fits[f'NAXIS{idx}'] for idx in range(1, header.fits['NAXIS'] + 1)] S: int = B * G * (P + np.prod(N)) return int(S / BLOCK_SIZE) * BLOCK_SIZE + header.offset + header.length elif header.fits.get('XTENSION', None) in ['BINTABLE']: # NAXIS1 = number of bytes per row # NAXIS2 = number of rows in the table return header.fits['NAXIS1'] * header.fits['NAXIS2'] + header.offset + header.length else: # import pdb; pdb.set_trace() pass raise NotImplementedError
/** * Attach the DOMElement to the GWT container, if not already attached. */ public void attach() { final Iterator<Widget> itr = domElementContainer.iterator(); while ( itr.hasNext() ) { if ( itr.next().equals( container ) ) { return; } } final Style style = container.getElement().getStyle(); style.setPosition( Style.Position.ABSOLUTE ); domElementContainer.add( container ); }
// time java -server binarytrees 20 public final class binarytrees { private static final int MIN_DEPTH = 4; public static void main(String args[]) { int n = args.length > 0 ? Integer.parseInt(args[0]) : 0; int maxDepth = Math.max(MIN_DEPTH + 2, n); int stretchDepth = maxDepth + 1; int check = Node.create(0, stretchDepth).check(); System.out.printf("stretch tree of depth %d\t check: %d\n", stretchDepth, check); Node longLived = Node.create(0, maxDepth); for (int depth = MIN_DEPTH; depth <= maxDepth; depth += 2) { int iterations = 1 << (maxDepth - depth + MIN_DEPTH); check = 0; for (int i = 1; i <= iterations; ++i) { check += Node.create(i, depth).check(); check += Node.create(-i, depth).check(); } System.out.printf("%d\t trees of depth %d\t check: %d\n", 2 * iterations, depth, check); } System.out.printf("long lived tree of depth %d\t check: %d\n", maxDepth, longLived.check()); } private static class Node { private int item; private Node left, right; private static Node create(int item, int depth) { if (depth > 0) { return new Node(item, create(2 * item - 1, depth - 1), create(2 * item, depth - 1)); } else { return new Node(item); } } private Node(int item_, Node left_, Node right_) { item = item_; left = left_; right = right_; } private Node(int item_) { this(item_, null, null); } private int check() { if (left == null) { return item; } return left.check() - right.check() + item; } } }
def _std_cache_path(observatory, root_env, subdir): if root_env + "_SINGLE" in os.environ: path = os.environ[root_env + "_SINGLE"] elif root_env in os.environ: path = os.path.join(os.environ[root_env], observatory) elif "CRDS_PATH_SINGLE" in os.environ: path = os.path.join(os.environ["CRDS_PATH_SINGLE"], subdir) elif "CRDS_PATH" in os.environ: path = os.path.join(os.environ["CRDS_PATH"], subdir, observatory) else: path = os.path.join(CRDS_DEFAULT_CACHE, subdir, observatory) return _clean_path(path)
/** * DLC Catalog client pool. */ public class DLCWrappedHybrisClientPool extends ClientPoolImpl<IMetaStoreClient, TException> { // use appropriate ctor depending on whether we're working with Hive2 or Hive3 dependencies // we need to do this because there is a breaking API change between Hive2 and Hive3 private static final DynConstructors.Ctor<DLCDataCatalogMetastoreClient> CLIENT_CTOR = DynConstructors.builder() .impl(DLCDataCatalogMetastoreClient.class, HiveConf.class) .impl(DLCDataCatalogMetastoreClient.class, Configuration.class).build(); private final HiveConf hiveConf; public DLCWrappedHybrisClientPool(int poolSize, Configuration conf) { // Do not allow retry by default as we rely on RetryingHiveClient super(poolSize, TTransportException.class, false); this.hiveConf = new HiveConf(conf, DLCWrappedHybrisClientPool.class); this.hiveConf.addResource(conf); } @Override protected IMetaStoreClient newClient() { try { try { return CLIENT_CTOR.newInstance(hiveConf); } catch (RuntimeException e) { // any MetaException would be wrapped into RuntimeException during reflection, // so let's double-check type here if (e.getCause() instanceof MetaException) { throw (MetaException) e.getCause(); } throw e; } } catch (MetaException e) { throw new RuntimeMetaException(e, "Failed to connect to Hive Metastore"); } catch (Throwable t) { if (t.getMessage().contains("Another instance of Derby may have already booted")) { throw new RuntimeMetaException(t, "Failed to start an embedded metastore because embedded " + "Derby supports only one client at a time. To fix this, use a metastore that supports " + "multiple clients."); } throw new RuntimeMetaException(t, "Failed to connect to Hive Metastore"); } } @Override protected IMetaStoreClient reconnect(IMetaStoreClient client) { try { client.close(); client.reconnect(); } catch (MetaException e) { throw new RuntimeMetaException(e, "Failed to reconnect to Hive Metastore"); } return client; } @Override protected boolean isConnectionException(Exception e) { return super.isConnectionException(e) || (e != null && e instanceof MetaException && e.getMessage().contains("Got exception: org.apache.thrift.transport.TTransportException")); } @Override protected void close(IMetaStoreClient client) { client.close(); } @VisibleForTesting HiveConf hiveConf() { return hiveConf; } }
Open-wheel driver RC Enerson will complete PR1/Mathisen Motorsports’ lineup for the Rolex 24 at Daytona, the team confirmed on Wednesday, ahead of this weekend’s Roar Before the 24. The 19-year-old Indy Lights graduate, who took part in three Verizon IndyCar Series rounds last year for Dale Coyne Racing, will join Tom Kimber-Smith, Jose Gutierrez and Mike Guasch at the wheel of the team’s new Ligier JS P217 Gibson. “Before this opportunity, I was primarily focused on the open wheel side of racing and making my way to the IndyCar Series,” Enerson said. “I’m still working on other IndyCar prospects for the 2017 season, but wanted to find a home where I could continue to race now. “My driver coach was able to put me in contact with Bobby [Oergel, team owner]. We met in Sebring a few weeks ago during a test, and we decided PR1 would be a great fit. “Now we’re excited to see what we can do on the sports car side of things at Daytona.” Enerson will get his first laps in the LMP2 contender at the Roar this weekend. The car, meanwhile, will carry primary sponsorship from Austrian-based e-cigarette and vaping company Von Erl for Daytona.
from math import gcd from collections import defaultdict n = int(input()) AB = [list(map(int, input().split())) for _ in range(n)] MOD = 1000000007 box = defaultdict(int) zeros = 0 for a, b in AB: if a == b == 0: zeros += 1 else: if a != 0 and b == 0: box[(-1, 1, 0)] += 1 elif a == 0 and b != 0: box[(1, 0, 1)] += 1 else: g = gcd(a, b) ga = a // g gb = b // g if (a // b) < 0: s = -1 else: s = 1 box[(s, abs(ga), abs(gb))] += 1 nakawaru = dict() others = 0 for (s, i, j), v in box.items(): if (-s, j, i) in box.keys(): if (s, i, j) not in nakawaru.keys() and (-s, j, i) not in nakawaru.keys(): nakawaru[(s, i, j)] = (box[(s, i, j)], box[(-s, j, i)]) else: others += v seed = 1 for i, j in nakawaru.values(): seed *= (pow(2, i, MOD) + pow(2, j, MOD) - 1) seed %= MOD ans = zeros + pow(2, others, MOD) * seed - 1 ans %= MOD print(ans)
<reponame>heavySea/caravel_user_project_mflowgen #========================================================================= # generate_init_def_with_od_metal.py #========================================================================= # This script takes the last generated def file from the openlane # floorplan step and removes all stripes and vias accross the core area # as well as the power/ground cell connections, but leaves off-die metal # pins and rings # # Author : <NAME> # Date : 17.05.2021 from shutil import copyfile import re # Define some helper functions # Some are derived from https://github.com/google/skywater-pdk/pull/185 def find_highest_xy_match(matchobj, r_index): res_i=0 i=0 lowest_value = None for match in matchobj: if (lowest_value==None or int(match[r_index]) > lowest_value): lowest_value = int(match[r_index]) res_i = i i=i+1 return res_i def find_lowest_xy_match(matchobj, r_index): res_i=0 i=0 lowest_value = None for match in matchobj: if (lowest_value==None or int(match[r_index]) < lowest_value): lowest_value = int(match[r_index]) res_i = i i=i+1 return res_i # shorten the PGN Stripes to let them be available as Pins def shorten_pgn_stripes(text, net_name): # Find all vertical pg stripes find = r'( - ' + net_name + r'(\.\w+)? \+ NET ' + net_name + r' (\+ SPECIAL \+ .*?)' \ + r' \+ FIXED \( (\-*\w+) (\-*\w+) \) N' \ + r' \+ LAYER met4 \( \-?(\w+) \-?(\w+) \) \( \-?(\w+) \-?(\w+) \) \;\n)' vert_stripes = re.findall(find, text) # remember number of original pins pin_count=len(vert_stripes) # pop the ring stripes top_ring=vert_stripes.pop(find_highest_xy_match(vert_stripes, 3)) bottom_ring=vert_stripes.pop(find_lowest_xy_match(vert_stripes, 3)) # Cut and shrink the stripes to leave only the minimal physical IO pins in the IO box # Some definitions: # Stripe pin length (how far should it go inside the die area?) stripe_pin_length='2400' # As long as the signal io pins # list for the new pins new_vert_stripes = [] # also remember location and width, migth be usefull for stripe generation in innovus? vert_stripe_positions_width = [] # Add the Ring pins back new_vert_stripes.append(' - ' + net_name \ + ' + NET ' + net_name + ' ' + top_ring[2] \ + ' + FIXED ( ' + top_ring[3] + ' ' + top_ring[4] + ' ) N' \ + ' + LAYER met4 ( -' + top_ring[5] + ' -' + top_ring[6] +' )' \ + ' ( ' + top_ring[7] + ' ' + top_ring[8] +' ) ;\n') new_vert_stripes.append(' - ' + net_name \ + ' + NET ' + net_name + ' ' + bottom_ring[2] \ + ' + FIXED ( ' + bottom_ring[3] + ' ' + bottom_ring[4] + ' ) N' \ + ' + LAYER met4 ( -' + bottom_ring[5] + ' ' + bottom_ring[6] + ' )' \ + ' ( ' + bottom_ring[7] + ' ' + bottom_ring[8] + ' ) ;\n') # stripe pin generation stripe_no=1 for stripe in vert_stripes: # get relevant positions from the original # X position x_pos = stripe[3] # pin width rect_start_x_offset = stripe[5] rect_end_x_offset = stripe[7] # calculate y off-die offsets y_pos=stripe[4] rect_end_y_offset = stripe[8] y_off_die_offset_b = str(int(rect_end_y_offset) - int(y_pos)) # Original pin location is not placed in the middle y_off_die_offset_t =str(int(y_off_die_offset_b) - 320) #print("Y pos:" + y_pos + "; Rect End Offset: " + rect_end_y_offset + "; Y off die offset: " + y_off_die_offset) # Signal Information signal_info = stripe[2] # generate top pin new_vert_stripes.append(' - ' + net_name \ + ' + NET ' + net_name + ' ' + signal_info \ + ' + FIXED ( ' + x_pos + ' 3520000 ) N' \ + ' + LAYER met4 ( -' + rect_start_x_offset + ' -' + stripe_pin_length +' )' \ + ' ( ' + rect_end_x_offset + ' ' + y_off_die_offset_t + ' ) ;\n') # generate bottom pin new_vert_stripes.append(' - ' + net_name \ + ' + NET ' + net_name + ' ' + signal_info \ + ' + FIXED ( ' + x_pos + ' 0 ) N' \ + ' + LAYER met4 ( -' + rect_start_x_offset + ' -' + y_off_die_offset_b + ' )' \ + ' ( ' + rect_end_x_offset + ' ' + stripe_pin_length + ' ) ;\n') # save stripe position vert_stripe_positions_width.append([x_pos, int(rect_start_x_offset) + int(rect_end_x_offset)]) stripe_no = stripe_no + 1 # do the same with the horizontal stripes find = r'( - ' + net_name + r'(\.\w+)? \+ NET ' + net_name + r' (\+ SPECIAL \+ .*?)' \ + r' \+ FIXED \( (\-*\w+) (\-*\w+) \) N' \ + r' \+ LAYER met5 \( \-?(\w+) \-?(\w+) \) \( \-?(\w+) \-?(\w+) \) \;\n)' horizontal_stripes = re.findall(find, text) # remember number of original pins pin_count=pin_count + len(horizontal_stripes) # remove the stripes outside of the die area right_ring=horizontal_stripes.pop(find_highest_xy_match(horizontal_stripes,4)) left_ring=horizontal_stripes.pop(find_lowest_xy_match(horizontal_stripes,4)) new_horizontal_stripes = [] horizontal_stripe_positions_width = [] # Add the Ring pins back new_horizontal_stripes.append(' - ' + net_name \ + ' + NET ' + net_name + ' ' + left_ring[2] \ + ' + FIXED ( ' + left_ring[3] + ' ' + left_ring[4] + ' ) N' \ + ' + LAYER met5 ( ' + left_ring[5] + ' -' + left_ring[6] + ' )' \ + ' ( ' + left_ring[7] + ' ' + left_ring[8] + ' ) ;\n') new_horizontal_stripes.append(' - ' + net_name \ + ' + NET ' + net_name + ' ' + right_ring[2] \ + ' + FIXED ( ' + right_ring[3] + ' ' + right_ring[4] + ' ) N' \ + ' + LAYER met5 ( -'+ right_ring[5] + ' -' + right_ring[6] + ' )' \ + ' ( ' + right_ring[7] + ' ' + right_ring[8] + ' ) ;\n') stripe_no=1 for stripe in horizontal_stripes: # get relevant positions from the original # Y position y_pos = stripe[4] # pin width rect_start_y_offset = stripe[6] rect_end_y_offset = stripe[8] # calculate x off-die offsets x_pos=stripe[3] rect_end_x_offset = stripe[7] x_off_die_offset_l = str(int(rect_end_x_offset) - int(x_pos)) #Original pin location is not placed in the middle x_off_die_offset_r = str(int(x_off_die_offset_l) - 380) # Original pin location is not placed in the middle #x_off_die_offset_t =str(int(y_off_die_offset_b) - 320) # Signal Information signal_info = stripe[2] # generate left pin new_horizontal_stripes.append(' - ' + net_name \ + ' + NET ' + net_name + ' ' + signal_info \ + ' + FIXED ( 0 ' + y_pos + ' ) N' \ + ' + LAYER met5 ( -' + x_off_die_offset_l + ' -' + rect_start_y_offset + ' )' \ + ' ( ' + stripe_pin_length + ' ' + rect_end_y_offset + ' ) ;\n') # generate right pin new_horizontal_stripes.append(' - ' + net_name \ + ' + NET ' + net_name + ' ' + signal_info \ + ' + FIXED ( 2920000 ' + y_pos + ' ) N' \ + ' + LAYER met5 ( -'+ stripe_pin_length + ' -' + rect_start_y_offset + ' )' \ + ' ( ' + x_off_die_offset_r + ' ' + rect_end_y_offset + ' ) ;\n') # save stripe position horizontal_stripe_positions_width.append([y_pos ,int(rect_start_y_offset) + int(rect_end_y_offset)]) stripe_no = stripe_no + 1 # replace the whole pin definition block replace='' for stripe in new_vert_stripes: replace = replace + stripe for stripe in new_horizontal_stripes: replace = replace + stripe # find and replace the whole block find = r'(( - ' + net_name + r' \+ NET .*? \+ LAYER met4 .*? ;\n)' \ + r'(.|\n)*?' \ + r'( - ' + net_name + r'.\w+ .*? \+ LAYER met4 .*? ;\n - ' + net_name + r'.\w+ .*? \+ LAYER met5 .*? ;\n)' \ + r'( - ' + net_name + r'.\w+ .*? \+ LAYER met5 .*? ;\n)*)' # migth be negativ! pins_removed = pin_count - len(new_vert_stripes) + len(new_horizontal_stripes) return (re.sub(find, replace, text), pins_removed, vert_stripe_positions_width, horizontal_stripe_positions_width) def edit_pin_count(text, removed_pins): find = r'PINS (\w+) ;\n' origig_pin_count = int(re.findall(find, text)[0]) new_pin_count = origig_pin_count - removed_pins return re.sub(find, ('PINS ' + str(new_pin_count) + ' ;\n\n'), text) def remove_m1_follow_pins(text): find = r'( NEW met1 480 \+ SHAPE FOLLOWPIN .*?\)\n)' text= re.sub(find, '', text) # There is one followpin stripe at last position.... find = r'(\n\s*NEW met1 480 \+ SHAPE FOLLOWPIN .*?\) ;\n)' return re.sub(find, '\n', text) def remove_m3_m2_m1_vias(text): find = r'(( \+ ROUTED)( met3 0 \+ SHAPE STRIPE \( \-?\w+ \-?\w+ \) via3_3000x480\n)' \ + r'(\n|.)*?\n' \ + r'( NEW met4 0 \+ SHAPE STRIPE \( \-?\w+ \-?\w+ \) via4_3000x3000\n))' replace = r'\2\n\5' text = re.sub(find, replace, text) # there will be a single + ROUTED line which will be fixed later # but it needs to be made uniformly for all pg nets to make next steps easier find = r'(( \+ ROUTED) (met4 0 \+ SHAPE STRIPE \( \-?\w+ \-?\w+ \) via4_3000x3000\n))' replace = r'\2\n NEW \3' return re.sub(find, replace, text) def __find_ring_vias(vias): # Vias between rings and stripes are outside of the die area! largest_xc = None largest_yc = None smallest_xc = None smallest_yc = None for via in vias: # indexes: 0= whole line, 2=x, 3=y if (largest_xc==None or largest_xc < int(via[2])): largest_xc=int(via[2]); if (smallest_xc==None or smallest_xc > int(via[2])): smallest_xc=int(via[2]); if (largest_yc==None or largest_yc < int(via[3])): largest_yc=int(via[3]); if (smallest_yc==None or smallest_yc > int(via[3])): smallest_yc=int(via[3]); # vias[0][1] = white space ring_vias='' for via in vias: if (int(via[2]) == largest_xc or int(via[2]) == smallest_xc or int(via[3])==largest_yc or int(via[3])==smallest_yc): ring_vias = ring_vias + vias[0][1] + "NEW met4 0 + SHAPE STRIPE ( " \ + via[2] + " " + via[3] \ + " ) via4_3000x3000\n" return ring_vias def __find_ring_vias_match(matchobj): vias = matchobj.group(2) find_c = r'((\s*)NEW met4 0 \+ SHAPE STRIPE \( (\-?\w+) (\-?\w+) \) via4_3000x3000\n)' via_c = re.findall(find_c, vias) # find all rign-stripe vias of each pg net ring_vias = __find_ring_vias(via_c) replace = "\n" + via_c[0][1] + "+ ROUTED\n" + ring_vias return replace def remove_stripe_vias(text): # remove all vias between stripes inside die area find = r'(\n\s*\+ ROUTED\n'\ + r'((\s*NEW met4 0 \+ SHAPE STRIPE \( (\-?\w+) (\-?\w+) \) via4_3000x3000\n){7,}))' text, no_of_subs = re.subn(find, __find_ring_vias_match, text) # fix the floating "+ ROUTER\n" find = r'((\s*\+ ROUTED)\n'\ + r'\s*NEW (met4 0 \+ SHAPE STRIPE \( \-?\w+ \-?\w+ \) via4_3000x3000\n))' replace = r'\2 \3' text = re.sub(find, replace, text) return text def remove_stripe_special_net_match(matchobj): stripe_pin_length='2400' # As long as the signal io pins header = matchobj.group(2) white_space = matchobj.group(3) # do not delete metal stripes of the ring # met4 are vertical stripes vertical_striped = matchobj.group(7) # met5 are hoizontal stripes horizontal_striped = matchobj.group(5) # Find most left/right stripe of vertical stripes find_stripes = r'(NEW met4 3000 \+ SHAPE STRIPE \( (\-?\w+) (\-?\w+) \) \( (\-?\w+) (\-?\w+) \))' vert_strip_matches = re.findall(find_stripes, vertical_striped) #print(vert_strip_matches) right_stripe = vert_strip_matches.pop(find_highest_xy_match(vert_strip_matches, 1))[0] left_stripe = vert_strip_matches.pop(find_lowest_xy_match(vert_strip_matches, 1))[0] # Shorten all other stripes - simmilar to the 'shorten_pgn_stripes' function, that shortens the pins # Not sure if nessecary yet # Find most left/right stripe of vertical stripes find_stripes = r'(NEW met5 3000 \+ SHAPE STRIPE \( (\-?\w+) (\-?\w+) \) \( \-?\w+ \-?\w+ \))' hori_strip_matches = re.findall(find_stripes, horizontal_striped) top_stripe = hori_strip_matches[find_highest_xy_match(hori_strip_matches, 2)][0] bottom_stripe = hori_strip_matches[find_lowest_xy_match(hori_strip_matches, 2)][0] replace = header + white_space + top_stripe + "\n" + white_space + bottom_stripe + "\n" + white_space + right_stripe + "\n" + white_space + left_stripe + " ;\n" return replace def shorten_stripe_special_net(text): find = r'((\s*- \w+ \( PIN .*?\n' \ + r'(\s*)\+ ROUTED .*\n\s+NEW met4(.|\n)*?\n)' \ + r'((\s*NEW met5 3000 .*?\n)+)' \ + r'((\s*NEW met4 3000 .*?\n)+))' return re.sub(find, remove_stripe_special_net_match, text) # Move pin location to die edge but keep original lenght inlcude off-die metal def replace_signal_io_location(matchobj): metal_layer = matchobj.group(5) #location of pin xy_coordinate = [int(matchobj.group(3)), int(matchobj.group(4))] # Also xy vectors, but interpreted as offsets from startpoint 'xy_coordinat' rect_offset_start = [int(matchobj.group(6)), int(matchobj.group(7))] rect_offset_end = [int(matchobj.group(8)), int(matchobj.group(9))] #print("(" + matchobj.group(1) + "\nCoordinate: (" + str(xy_coordinate) \ # +"); Rect_offset_start: (" + str(rect_offset_start)\ # + "); Rect_offset_end: (" + str(rect_offset_end) \ # + "); layer: " + metal_layer) orig_top_y_offset=3521200 orig_bottom_y_offset=-1200 orig_left_x_offset=-1200 orig_right_x_offset=2921200 # Top/Bottom or Left/Right? if metal_layer=="met2": #Top or Bottom? if xy_coordinate[1]==orig_top_y_offset: # remove pin offset xy_coordinate[1]=3520000 # shorten on-die pin length (start y is negative!) rect_offset_start[1]=rect_offset_start[1] + (orig_top_y_offset - 3520000) # extend off-die metal rect_offset_end[1]=rect_offset_end[1] + (orig_top_y_offset - 3520000) elif xy_coordinate[1]==orig_bottom_y_offset: # remove pin offset xy_coordinate[1]=0 # extend off-die metal rect_offset_start[1]=rect_offset_start[1] + orig_bottom_y_offset # shorten on-die pin length (end y is positive!) rect_offset_end[1]= rect_offset_end[1] + orig_bottom_y_offset else: raise ValueError("IO pin is not on expected offset of either " + str(orig_top_y_offset) \ + " or " + str(orig_bottom_y_offset)+". It is at " + str(xy_coordinate[1]) + "!\n" + "DEF file line:\n" + matchobj.group(1)) elif metal_layer=="met3": #right or left? if xy_coordinate[0]==orig_right_x_offset: # remove pin offset xy_coordinate[0]=2920000 # shorten on-die pin length (start x is negative!) rect_offset_start[0]=rect_offset_start[0] + (orig_right_x_offset - 2920000) # extend off-die metal rect_offset_end[0]=rect_offset_end[0] + (orig_right_x_offset - 2920000) elif xy_coordinate[0]==orig_left_x_offset: # remove pin offset xy_coordinate[0]=0 # extend off-die metal rect_offset_start[0]= rect_offset_start[0] + orig_left_x_offset # shorten on-die pin length (end y is positive!) rect_offset_end[0]= rect_offset_end[0] + orig_left_x_offset else: raise ValueError("IO pin is not on expected offset of either " + str(orig_top_y_offset) \ + " or " + str(orig_bottom_y_offset)+". It is at " + str(xy_coordinate[1]) + "!\n" + "DEF file line:\n" + matchobj.group(1)) else: raise ValueError("Not sure what kind of signal IO pin is on " + metal_layer + ". DEF file line:\n" + matchobj.group(1)) #generate replace line replace = matchobj.group(2) \ + " + PLACED ( " + str(xy_coordinate[0]) + " " + str(xy_coordinate[1]) + " ) N" \ + " + LAYER " + metal_layer \ + " ( " + str(rect_offset_start[0]) + " " + str(rect_offset_start[1]) + " )" \ + " ( " + str(rect_offset_end[0]) + " " + str(rect_offset_end[1]) + " ) ;\n" #print("Original: " + matchobj.group(1) + "\nReplacement: " + replace) return replace def fix_signal_io_placement(text): #- analog_io[0] + NET analog_io[0] + DIRECTION INOUT + USE SIGNAL + PLACED ( 2921200 1426980 ) N + LAYER met3 ( -3600 -600 ) ( 3600 600 ) ; find = r'\n((\s*- .+? \+ NET .+? \+ USE SIGNAL )' \ + r'\+ PLACED \( (\-?\w+) (\-?\w+) \) N' \ + r' \+ LAYER (\w+) \( (\-?\w+) (\-?\w+) \) \( (\-?\w+) (\-?\w+) \) \;)' #print(re.findall(find, text)) return re.sub(find, replace_signal_io_location, text) def gen_floorplan(): # excepts a def file from the last floorplanning stage of openlane d_file = open('10-pdn.def', 'r').read() # Remove all pg stripes over the core, but not the core ring pins_removed=0 d_file, p_rm, vert_stripes, horiz_stripes = shorten_pgn_stripes(d_file, 'vccd1') pins_removed = pins_removed + p_rm d_file, p_rm, vert_stripes, horiz_stripes = shorten_pgn_stripes(d_file, 'vssd1') pins_removed = pins_removed + p_rm d_file, p_rm, vert_stripes, horiz_stripes = shorten_pgn_stripes(d_file, 'vccd2') pins_removed = pins_removed + p_rm d_file, p_rm, vert_stripes, horiz_stripes = shorten_pgn_stripes(d_file, 'vssd2') pins_removed = pins_removed + p_rm d_file, p_rm, vert_stripes, horiz_stripes = shorten_pgn_stripes(d_file, 'vdda1') pins_removed = pins_removed + p_rm d_file, p_rm, vert_stripes, horiz_stripes = shorten_pgn_stripes(d_file, 'vssa1') pins_removed = pins_removed + p_rm d_file, p_rm, vert_stripes, horiz_stripes = shorten_pgn_stripes(d_file, 'vdda2') pins_removed = pins_removed + p_rm d_file, p_rm, vert_stripes, horiz_stripes = shorten_pgn_stripes(d_file, 'vssa2') pins_removed = pins_removed + p_rm # Since some Pins have been removed, the Pin count has to be changed as well d_file = edit_pin_count(d_file, pins_removed) # remove stripe via connections with cell pg stripes # all contained on met 3,2 and 1 d_file = remove_m3_m2_m1_vias(d_file) # remove all Stripe-Ring vias d_file = remove_stripe_vias(d_file) # remove all Stripe Special nets on metal 4 and metal 5 d_file = shorten_stripe_special_net(d_file) #Remove all pg_cell connection stripes d_file = remove_m1_follow_pins(d_file) # # Fix IO Pin placement to be on die edge and IO metal only on die d_file = fix_signal_io_placement(d_file) with open('outputs/user_project_wrapper.def','w') as write_file: write_file.write(d_file) #========================================================================= # Deprecated functions and edits #========================================================================= # The below edits remove the wohle stripes accross the die area and only # leave the rings outside of the die # this brings the problem, that innovus will complay about metal out of # the die area # Moreover the positions of the stripes are fixed! So we need to have at # least have some metal of the stripes as special net inputs! # With the code this is not fullfilled, since the complete stripes are # removed # Functions: # remove out-of-die pgn rings and stripes accross the die, leaving only pins in the IO area def remove_pgn_stripes_and_ring(text, net_name): # Find all vertical pg stripes find = r'( - ' + net_name + r'(\.\w+)? \+ NET ' + net_name + r' (\+ SPECIAL \+ .*?)' \ + r' \+ FIXED \( (\-*\w+) (\-*\w+) \) N' \ + r' \+ LAYER met4 \( \-?(\w+) \-?(\w+) \) \( \-?(\w+) \-?(\w+) \) \;\n)' vert_stripes = re.findall(find, text) # remember number of original pins pin_count=len(vert_stripes) # remove the stripes outside of the die area vert_stripes.pop(find_highest_xy_match(vert_stripes, 3)) vert_stripes.pop(find_lowest_xy_match(vert_stripes, 3)) # Cut and shrink the stripes to leave only the minimal physical IO pins in the IO box # Some definitions: # Stripe pin length (how far should it go inside the die area?) stripe_pin_length='2400' # As long as the signal io pins # list for the new pins new_vert_stripes = [] # also remember location and width, migth be usefull for stripe generation in innovus? vert_stripe_positions_width = [] # stripe pin generation stripe_no=1 for stripe in vert_stripes: # get relevant positions from the original # X position x_pos = stripe[3] # pin width rect_start_x_offset = stripe[5] rect_end_x_offset = stripe[7] # Signal Information signal_info = stripe[2] # generate top pin new_vert_stripes.append(' - ' + net_name + '.vert_t'+ str(stripe_no) \ + ' + NET ' + net_name + ' ' + signal_info \ + ' + FIXED ( ' + x_pos + ' 3520000 ) N' \ + ' + LAYER met4 ( -' + rect_start_x_offset + ' -' + stripe_pin_length +' )' \ + ' ( ' + rect_end_x_offset + ' 0 ) ;\n') # generate bottom pin new_vert_stripes.append(' - ' + net_name + '.vert_b'+ str(stripe_no) \ + ' + NET ' + net_name + ' ' + signal_info \ + ' + FIXED ( ' + x_pos + ' 0 ) N' \ + ' + LAYER met4 ( -' + rect_start_x_offset + ' 0 )' \ + ' ( ' + rect_end_x_offset + ' ' + stripe_pin_length + ' ) ;\n') # save stripe position vert_stripe_positions_width.append([x_pos, int(rect_start_x_offset) + int(rect_end_x_offset)]) stripe_no = stripe_no + 1 # do the same with the horizontal stripes find = r'( - ' + net_name + r'(\.\w+)? \+ NET ' + net_name + r' (\+ SPECIAL \+ .*?)' \ + r' \+ FIXED \( (\-*\w+) (\-*\w+) \) N' \ + r' \+ LAYER met5 \( \-?(\w+) \-?(\w+) \) \( \-?(\w+) \-?(\w+) \) \;\n)' horizontal_stripes = re.findall(find, text) # remember number of original pins pin_count=pin_count + len(horizontal_stripes) # remove the stripes outside of the die area horizontal_stripes.pop(find_highest_xy_match(horizontal_stripes,4)) horizontal_stripes.pop(find_lowest_xy_match(horizontal_stripes,4)) new_horizontal_stripes = [] horizontal_stripe_positions_width = [] stripe_no=1 for stripe in horizontal_stripes: # get relevant positions from the original # Y position y_pos = stripe[4] # pin width rect_start_y_offset = stripe[6] rect_end_y_offset = stripe[8] # Signal Information signal_info = stripe[2] # generate left pin new_horizontal_stripes.append(' - ' + net_name + '.hori_l'+ str(stripe_no) \ + ' + NET ' + net_name + ' ' + signal_info \ + ' + FIXED ( 0 ' + y_pos + ' ) N' \ + ' + LAYER met5 ( 0 -' + rect_start_y_offset + ' )' \ + ' ( ' + stripe_pin_length + ' ' + rect_end_y_offset + ' ) ;\n') # generate right pin new_horizontal_stripes.append(' - ' + net_name + '.hori_r'+ str(stripe_no) \ + ' + NET ' + net_name + ' ' + signal_info \ + ' + FIXED ( 2920000 ' + y_pos + ' ) N' \ + ' + LAYER met5 ( -'+ stripe_pin_length + ' -' + rect_start_y_offset + ' )' \ + ' ( 0 ' + rect_end_y_offset + ' ) ;\n') # save stripe position horizontal_stripe_positions_width.append([y_pos ,int(rect_start_y_offset) + int(rect_end_y_offset)]) stripe_no = stripe_no + 1 # replace the whole pin definition block replace='' for stripe in new_vert_stripes: replace = replace + stripe for stripe in new_horizontal_stripes: replace = replace + stripe # find and replace the whole block find = r'(( - ' + net_name + r' \+ NET .*? \+ LAYER met4 .*? ;\n)' \ + r'(.|\n)*?' \ + r'( - ' + net_name + r'.\w+ .*? \+ LAYER met4 .*? ;\n - ' + net_name + r'.\w+ .*? \+ LAYER met5 .*? ;\n)' \ + r'( - ' + net_name + r'.\w+ .*? \+ LAYER met5 .*? ;\n)*)' # migth be negativ! pins_removed = pin_count - len(new_vert_stripes) + len(new_horizontal_stripes) return (re.sub(find, replace, text), pins_removed, vert_stripe_positions_width, horizontal_stripe_positions_width) # # Remove all pg stripes over the core, but not the core ring # pins_removed=0 # d_file, p_rm, vert_stripes, horiz_stripes = remove_pgn_stripes_and_ring(d_file, 'vccd1') # pins_removed = pins_removed + p_rm # d_file, p_rm, vert_stripes, horiz_stripes = remove_pgn_stripes_and_ring(d_file, 'vssd1') # pins_removed = pins_removed + p_rm # d_file, p_rm, vert_stripes, horiz_stripes = remove_pgn_stripes_and_ring(d_file, 'vccd2') # pins_removed = pins_removed + p_rm # d_file, p_rm, vert_stripes, horiz_stripes = remove_pgn_stripes_and_ring(d_file, 'vssd2') # pins_removed = pins_removed + p_rm # d_file, p_rm, vert_stripes, horiz_stripes = remove_pgn_stripes_and_ring(d_file, 'vdda1') # pins_removed = pins_removed + p_rm # d_file, p_rm, vert_stripes, horiz_stripes = remove_pgn_stripes_and_ring(d_file, 'vssa1') # pins_removed = pins_removed + p_rm # d_file, p_rm, vert_stripes, horiz_stripes = remove_pgn_stripes_and_ring(d_file, 'vdda2') # pins_removed = pins_removed + p_rm # d_file, p_rm, vert_stripes, horiz_stripes = remove_pgn_stripes_and_ring(d_file, 'vssa2') # pins_removed = pins_removed + p_rm def remove_special_nets(text): find = r'(SPECIALNETS \w+ ;\n(\n|.)*?\nEND SPECIALNETS\n)' return re.sub(find, '\n', text) def remove_pgn_striped(text, net_name): find = r'( - ' + net_name + r'(\s|.\w+).*?\+ FIXED \( (\-*\w+) (\-*\w+) \) N \+ LAYER met4 .*? ;\n)' vert_stripes = re.findall(find, text) most_right_vertical_stripe = find_highest_xy_match(vert_stripes, 2) most_left_vertical_stripe = find_lowest_xy_match(vert_stripes, 2) find = r'( - ' + net_name + r'(\s|.\w+).*?\+ FIXED \( (\-*\w+) (\-*\w+) \) N \+ LAYER met5 .*? ;\n)' horiz_stripes = re.findall(find, text) highest_horizontal_stripe = find_highest_xy_match(horiz_stripes, 3) lowest_horizontal_stripe = find_lowest_xy_match(horiz_stripes, 3) replace = vert_stripes[most_right_vertical_stripe][0] + vert_stripes[most_left_vertical_stripe][0] \ + horiz_stripes[highest_horizontal_stripe][0] + horiz_stripes[lowest_horizontal_stripe][0] find = r'(( - ' + net_name + r' \+ NET .*? \+ LAYER met4 .*? ;\n)' \ + r'(.|\n)*?' \ + r'( - ' + net_name + r'.\w+ .*? \+ LAYER met4 .*? ;\n - ' + net_name + r'.\w+ .*? \+ LAYER met5 .*? ;\n)' \ + r'( - ' + net_name + r'.\w+ .*? \+ LAYER met5 .*? ;\n)*)' pins_removed = len(vert_stripes) + len(horiz_stripes) - 8 return (re.sub(find, replace, text), pins_removed) def __find_corner_vias(vias): # Find largest and smalest x and ycoordinate largest_xc = None largest_xc_i = 0 largest_yc = None largest_yc_i = 0 smallest_xc = None smallest_xc_i = 0 smallest_yc = None smallest_yc_i = 0 i=0 for via in vias: # indexes: 0= whole line, 2=x, 3=y if (largest_xc==None or largest_xc < int(via[2])): largest_xc=int(via[2]); largest_xc_i=i; if (smallest_xc==None or smallest_xc > int(via[2])): smallest_xc=int(via[2]); smallest_xc_i=i; if (largest_yc==None or largest_yc < int(via[3])): largest_yc=int(via[3]); largest_yc_i=i; if (smallest_yc==None or smallest_yc > int(via[3])): smallest_yc=int(via[3]); smallest_yc_i=i; i = i+1 # vias[0][1] = white space # top right corner corner_vias = vias[0][1] + "NEW met4 0 + SHAPE STRIPE ( " \ + str(largest_xc) + " " + str(largest_yc) \ + " ) via4_3000x3000\n" # top left corner corner_vias = corner_vias + vias[0][1] + "NEW met4 0 + SHAPE STRIPE ( " \ + str(smallest_xc) + " " + str(largest_yc) \ + " ) via4_3000x3000\n" # bottom right corner corner_vias = corner_vias + vias[0][1] + "NEW met4 0 + SHAPE STRIPE ( " \ + str(largest_xc) + " " + str(smallest_yc) \ + " ) via4_3000x3000\n" # bottom left corner corner_vias = corner_vias + vias[0][1] + "NEW met4 0 + SHAPE STRIPE ( " \ + str(smallest_xc) + " " + str(smallest_yc) \ + " ) via4_3000x3000\n" return corner_vias def remove_stripe_ring_vias(text): # all vias are between m4 and m5, "via4" find = r'(\n\s*\+ ROUTED\n'\ + r'((\s*NEW met4 0 \+ SHAPE STRIPE \( (\-?\w+) (\-?\w+) \) via4_3000x3000\n){7,}))' via_groups = re.findall(find, text) for group in via_groups: vias = group[1] # Find all Coordinates find_c = r'((\s*)NEW met4 0 \+ SHAPE STRIPE \( (\-?\w+) (\-?\w+) \) via4_3000x3000\n)' via_c = re.findall(find_c, vias) # find all corner vias of each pg net corner_visas = __find_corner_vias(via_c) replace = "\n" + via_c[0][1] + "+ ROUTED\n" + corner_visas # only replace this once, otherwise the following groups are not replaced correctly! text = re.sub(find, replace, text, count=1) # fix the floating "+ ROUTER\n" find = r'((\s*\+ ROUTED)\n'\ + r'\s*NEW (met4 0 \+ SHAPE STRIPE \( \-?\w+ \-?\w+ \) via4_3000x3000\n))' replace = r'\2 \3' text = re.sub(find, replace, text) return text def fix_floating_ROUTED(text): find = r'(( \+ ROUTED)\n\s*NEW (met\w .+?)\n)' replace = r'\2 \3\n' return re.sub(find, replace, text) # Executed steps # # Remove all pg stripes over the core, but not the core ring # pins_removed=0 # d_file, p_rm = remove_pgn_striped(d_file, 'vccd1') # pins_removed = pins_removed + p_rm # d_file, p_rm = remove_pgn_striped(d_file, 'vssd1') # pins_removed = pins_removed + p_rm # d_file, p_rm = remove_pgn_striped(d_file, 'vccd2') # pins_removed = pins_removed + p_rm # d_file, p_rm = remove_pgn_striped(d_file, 'vssd2') # pins_removed = pins_removed + p_rm # d_file, p_rm = remove_pgn_striped(d_file, 'vdda1') # pins_removed = pins_removed + p_rm # d_file, p_rm = remove_pgn_striped(d_file, 'vssa1') # pins_removed = pins_removed + p_rm # d_file, p_rm = remove_pgn_striped(d_file, 'vdda2') # pins_removed = pins_removed + p_rm # d_file, p_rm = remove_pgn_striped(d_file, 'vssa2') # pins_removed = pins_removed + p_rm # # remove stripe via connections with cell pg stripes # # all contained on met 3,2 and 1 # d_file = remove_m3_m2_m1_vias(d_file) # # remove all Stripe-Ring vias # d_file = remove_stripe_ring_vias(d_file) # # remove all Stripe Special nets on metal 4 and metal 5 # d_file = remove_stripe_special_net(d_file) # # Fix Floating ROUTED # #d_file = fix_floating_ROUTED(d_file) # Remove all pg_cell connection stripes # d_file = remove_m1_follow_pins(d_file)
/** * Add remaining unmatched freshRects as new TrackItems * * @param vector<Rect> * @return void */ void Tracker::addNewItems(std::vector<Rect>& freshDetects) { for (uint i=0; i<freshDetects.size(); ++i) add(new TrackItem(freshDetects[i])); }
import { Container, Nav, Navbar } from 'react-bootstrap' import React from 'react' import { NavigationBase } from './Navigation.style' import { Brand } from '../../../../components/atoms' import { SectionMainMenu } from '../../../../components/molecules' const Navigation = () => { return ( <NavigationBase> <Navbar expand='lg'> <Container> <Brand brandName={'Kyomi Mountaineering'} href={'/'} /> <Navbar.Toggle aria-controls='basic-navbar-nav' /> <Navbar.Collapse id='basic-navbar-nav'> <SectionMainMenu /> </Navbar.Collapse> </Container> </Navbar> </NavigationBase> ) } export default Navigation
. 55 patients, aged 19 to 77 years, with consequences of humeral fractures were surgically treated. 1st group consisted of 17 patients with slow fracture consolidation, 2nd group contained 31 patients with uninfected false joints and the 3rd group consisted of 7 patients with infected false joints. Surgical tactics of treatment in each group was thoroughly described. Long-term results were analyzed in 38 patients. Good results were achieved in 27 cases, satisfactory--in 7 cases and unsatisfactory results were registered in 4 patients. Cases of nonconsolidation of bone fragments, requiring repeated operations, were assessed as unsatisfactory.
/** * Activity to illustrate querying files that are starred and text. */ public class QueryStarredTextFilesActivity extends BaseDemoActivity { private ListView mResultsListView; private ResultsAdapter mResultsAdapter; @Override protected void onCreate(Bundle b) { super.onCreate(b); setContentView(R.layout.activity_listfiles); mResultsListView = (ListView) findViewById(R.id.listViewResults); mResultsAdapter = new ResultsAdapter(this); mResultsListView.setAdapter(mResultsAdapter); } /** * Clears the result buffer to avoid memory leaks as soon as the activity is no longer * visible by the user. */ @Override protected void onStop() { super.onStop(); mResultsAdapter.clear(); } @Override public void onConnected(Bundle connectionHint) { super.onConnected(connectionHint); Query query = new Query.Builder() .addFilter(Filters.and( Filters.eq(SearchableField.MIME_TYPE, "text/plain"), Filters.eq(SearchableField.STARRED, true))) .build(); Drive.DriveApi.query(getGoogleApiClient(), query) .setResultCallback(metadataCallback); } final private ResultCallback<DriveApi.MetadataBufferResult> metadataCallback = new ResultCallback<DriveApi.MetadataBufferResult>() { @Override public void onResult(DriveApi.MetadataBufferResult result) { if (!result.getStatus().isSuccess()) { showMessage("Problem while retrieving results"); return; } mResultsAdapter.clear(); mResultsAdapter.append(result.getMetadataBuffer()); } }; }
<reponame>zipated/src<gh_stars>1000+ // Copyright 2017 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. package org.chromium.chrome.browser.payments; import android.content.Intent; import android.content.pm.ActivityInfo; import android.content.pm.ApplicationInfo; import android.content.pm.PackageInfo; import android.content.pm.ResolveInfo; import android.content.pm.ServiceInfo; import android.content.pm.Signature; import android.os.Bundle; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.ArgumentMatcher; import org.mockito.ArgumentMatchers; import org.mockito.Mockito; import org.robolectric.RobolectricTestRunner; import org.robolectric.annotation.Config; import org.chromium.chrome.browser.payments.PaymentAppFactory.PaymentAppCreatedCallback; import org.chromium.components.payments.PaymentManifestDownloader; import org.chromium.components.payments.PaymentManifestParser; import org.chromium.components.payments.WebAppManifestSection; import org.chromium.content_public.browser.WebContents; import java.net.URI; import java.net.URISyntaxException; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; /** Tests for the native Android payment app finder. */ @RunWith(RobolectricTestRunner.class) @Config(sdk = 21, manifest = Config.NONE) public class AndroidPaymentAppFinderUnitTest { private static final IntentArgumentMatcher sPayIntentArgumentMatcher = new IntentArgumentMatcher(new Intent("org.chromium.intent.action.PAY")); public AndroidPaymentAppFinderUnitTest() {} /** * Argument matcher that matches Intents using |filterEquals| method. */ private static class IntentArgumentMatcher implements ArgumentMatcher<Intent> { private final Intent mIntent; public IntentArgumentMatcher(Intent intent) { mIntent = intent; } @Override public boolean matches(Intent other) { return mIntent.filterEquals(other); } @Override public String toString() { return mIntent.toString(); } } @Test public void testNoValidPaymentMethodNames() { Set<String> methodNames = new HashSet<>(); methodNames.add("unknown-payment-method-name"); methodNames.add("http://not.secure.payment.method.name.com"); methodNames.add("https://"); // Invalid URI. PaymentAppCreatedCallback callback = Mockito.mock(PaymentAppCreatedCallback.class); AndroidPaymentAppFinder.find(Mockito.mock(WebContents.class), methodNames, Mockito.mock(PaymentManifestWebDataService.class), Mockito.mock(PaymentManifestDownloader.class), Mockito.mock(PaymentManifestParser.class), Mockito.mock(PackageManagerDelegate.class), callback); Mockito.verify(callback, Mockito.never()) .onPaymentAppCreated(Mockito.any(PaymentApp.class)); Mockito.verify(callback).onAllPaymentAppsCreated(); } @Test public void testQueryWithoutApps() { PackageManagerDelegate packageManagerDelegate = Mockito.mock(PackageManagerDelegate.class); Mockito.when(packageManagerDelegate.getActivitiesThatCanRespondToIntentWithMetaData( ArgumentMatchers.argThat(sPayIntentArgumentMatcher))) .thenReturn(new ArrayList<ResolveInfo>()); Set<String> methodNames = new HashSet<>(); methodNames.add("basic-card"); PaymentAppCreatedCallback callback = Mockito.mock(PaymentAppCreatedCallback.class); AndroidPaymentAppFinder.find(Mockito.mock(WebContents.class), methodNames, Mockito.mock(PaymentManifestWebDataService.class), Mockito.mock(PaymentManifestDownloader.class), Mockito.mock(PaymentManifestParser.class), packageManagerDelegate, callback); Mockito.verify(packageManagerDelegate, Mockito.never()) .getStringArrayResourceForApplication( ArgumentMatchers.any(ApplicationInfo.class), ArgumentMatchers.anyInt()); Mockito.verify(callback, Mockito.never()) .onPaymentAppCreated(Mockito.any(PaymentApp.class)); Mockito.verify(callback).onAllPaymentAppsCreated(); } @Test public void testQueryWithoutMetaData() { List<ResolveInfo> activities = new ArrayList<>(); ResolveInfo alicePay = new ResolveInfo(); alicePay.activityInfo = new ActivityInfo(); alicePay.activityInfo.packageName = "com.alicepay.app"; alicePay.activityInfo.name = "com.alicepay.app.WebPaymentActivity"; activities.add(alicePay); PackageManagerDelegate packageManagerDelegate = Mockito.mock(PackageManagerDelegate.class); Mockito.when(packageManagerDelegate.getActivitiesThatCanRespondToIntentWithMetaData( ArgumentMatchers.argThat(sPayIntentArgumentMatcher))) .thenReturn(activities); Set<String> methodNames = new HashSet<>(); methodNames.add("basic-card"); PaymentAppCreatedCallback callback = Mockito.mock(PaymentAppCreatedCallback.class); AndroidPaymentAppFinder.find(Mockito.mock(WebContents.class), methodNames, Mockito.mock(PaymentManifestWebDataService.class), Mockito.mock(PaymentManifestDownloader.class), Mockito.mock(PaymentManifestParser.class), packageManagerDelegate, callback); Mockito.verify(packageManagerDelegate, Mockito.never()) .getStringArrayResourceForApplication( ArgumentMatchers.any(ApplicationInfo.class), ArgumentMatchers.anyInt()); Mockito.verify(callback, Mockito.never()) .onPaymentAppCreated(Mockito.any(PaymentApp.class)); Mockito.verify(callback).onAllPaymentAppsCreated(); } @Test public void testQueryWithUnsupportedPaymentMethod() { List<ResolveInfo> activities = new ArrayList<>(); ResolveInfo alicePay = new ResolveInfo(); alicePay.activityInfo = new ActivityInfo(); alicePay.activityInfo.packageName = "com.alicepay.app"; alicePay.activityInfo.name = "com.alicepay.app.WebPaymentActivity"; Bundle activityMetaData = new Bundle(); activityMetaData.putString( AndroidPaymentAppFinder.META_DATA_NAME_OF_DEFAULT_PAYMENT_METHOD_NAME, "basic-card"); alicePay.activityInfo.metaData = activityMetaData; activities.add(alicePay); PackageManagerDelegate packageManagerDelegate = Mockito.mock(PackageManagerDelegate.class); Mockito.when(packageManagerDelegate.getActivitiesThatCanRespondToIntentWithMetaData( ArgumentMatchers.argThat(sPayIntentArgumentMatcher))) .thenReturn(activities); Set<String> methodNames = new HashSet<>(); methodNames.add("basic-card"); PaymentAppCreatedCallback callback = Mockito.mock(PaymentAppCreatedCallback.class); AndroidPaymentAppFinder.find(Mockito.mock(WebContents.class), methodNames, Mockito.mock(PaymentManifestWebDataService.class), Mockito.mock(PaymentManifestDownloader.class), Mockito.mock(PaymentManifestParser.class), packageManagerDelegate, callback); Mockito.verify(packageManagerDelegate, Mockito.never()) .getStringArrayResourceForApplication( ArgumentMatchers.any(ApplicationInfo.class), ArgumentMatchers.anyInt()); Mockito.verify(callback, Mockito.never()) .onPaymentAppCreated(Mockito.any(PaymentApp.class)); Mockito.verify(callback).onAllPaymentAppsCreated(); } @Test public void testQueryBasicCardsWithTwoApps() { List<ResolveInfo> activities = new ArrayList<>(); ResolveInfo alicePay = new ResolveInfo(); alicePay.activityInfo = new ActivityInfo(); alicePay.activityInfo.packageName = "com.alicepay.app"; alicePay.activityInfo.name = "com.alicepay.app.WebPaymentActivity"; alicePay.activityInfo.applicationInfo = new ApplicationInfo(); Bundle alicePayMetaData = new Bundle(); alicePayMetaData.putString( AndroidPaymentAppFinder.META_DATA_NAME_OF_DEFAULT_PAYMENT_METHOD_NAME, "basic-card"); alicePayMetaData.putInt(AndroidPaymentAppFinder.META_DATA_NAME_OF_PAYMENT_METHOD_NAMES, 1); alicePay.activityInfo.metaData = alicePayMetaData; activities.add(alicePay); ResolveInfo bobPay = new ResolveInfo(); bobPay.activityInfo = new ActivityInfo(); bobPay.activityInfo.packageName = "com.bobpay.app"; bobPay.activityInfo.name = "com.bobpay.app.WebPaymentActivity"; bobPay.activityInfo.applicationInfo = new ApplicationInfo(); Bundle bobPayMetaData = new Bundle(); bobPayMetaData.putString( AndroidPaymentAppFinder.META_DATA_NAME_OF_DEFAULT_PAYMENT_METHOD_NAME, "basic-card"); bobPayMetaData.putInt(AndroidPaymentAppFinder.META_DATA_NAME_OF_PAYMENT_METHOD_NAMES, 2); bobPay.activityInfo.metaData = bobPayMetaData; activities.add(bobPay); PackageManagerDelegate packageManagerDelegate = Mockito.mock(PackageManagerDelegate.class); Mockito.when(packageManagerDelegate.getAppLabel(Mockito.any(ResolveInfo.class))) .thenReturn("A non-empty label"); Mockito.when(packageManagerDelegate.getActivitiesThatCanRespondToIntentWithMetaData( ArgumentMatchers.argThat(sPayIntentArgumentMatcher))) .thenReturn(activities); Mockito.when(packageManagerDelegate.getServicesThatCanRespondToIntent( ArgumentMatchers.argThat(new IntentArgumentMatcher( new Intent(AndroidPaymentAppFinder.ACTION_IS_READY_TO_PAY))))) .thenReturn(new ArrayList<ResolveInfo>()); Mockito.when(packageManagerDelegate.getStringArrayResourceForApplication( ArgumentMatchers.eq(alicePay.activityInfo.applicationInfo), ArgumentMatchers.eq(1))) .thenReturn(new String[] {"https://alicepay.com"}); Mockito.when(packageManagerDelegate.getStringArrayResourceForApplication( ArgumentMatchers.eq(bobPay.activityInfo.applicationInfo), ArgumentMatchers.eq(2))) .thenReturn(new String[] {"https://bobpay.com"}); Set<String> methodNames = new HashSet<>(); methodNames.add("basic-card"); PaymentAppCreatedCallback callback = Mockito.mock(PaymentAppCreatedCallback.class); AndroidPaymentAppFinder.find(Mockito.mock(WebContents.class), methodNames, Mockito.mock(PaymentManifestWebDataService.class), Mockito.mock(PaymentManifestDownloader.class), Mockito.mock(PaymentManifestParser.class), packageManagerDelegate, callback); Mockito.verify(callback).onPaymentAppCreated( ArgumentMatchers.argThat(Matches.paymentAppIdentifier("com.alicepay.app"))); Mockito.verify(callback).onPaymentAppCreated( ArgumentMatchers.argThat(Matches.paymentAppIdentifier("com.bobpay.app"))); Mockito.verify(callback).onAllPaymentAppsCreated(); } @Test public void testQueryBobPayWithOneAppThatHasIsReadyToPayService() { List<ResolveInfo> activities = new ArrayList<>(); ResolveInfo bobPay = new ResolveInfo(); bobPay.activityInfo = new ActivityInfo(); bobPay.activityInfo.packageName = "com.bobpay.app"; bobPay.activityInfo.name = "com.bobpay.app.WebPaymentActivity"; bobPay.activityInfo.applicationInfo = new ApplicationInfo(); Bundle bobPayMetaData = new Bundle(); bobPayMetaData.putString( AndroidPaymentAppFinder.META_DATA_NAME_OF_DEFAULT_PAYMENT_METHOD_NAME, "https://bobpay.com"); bobPayMetaData.putInt(AndroidPaymentAppFinder.META_DATA_NAME_OF_PAYMENT_METHOD_NAMES, 1); bobPay.activityInfo.metaData = bobPayMetaData; activities.add(bobPay); PackageManagerDelegate packageManagerDelegate = Mockito.mock(PackageManagerDelegate.class); Mockito.when(packageManagerDelegate.getAppLabel(Mockito.any(ResolveInfo.class))) .thenReturn("A non-empty label"); Mockito.when(packageManagerDelegate.getActivitiesThatCanRespondToIntentWithMetaData( ArgumentMatchers.argThat(sPayIntentArgumentMatcher))) .thenReturn(activities); Mockito.when(packageManagerDelegate.getStringArrayResourceForApplication( ArgumentMatchers.eq(bobPay.activityInfo.applicationInfo), ArgumentMatchers.eq(1))) .thenReturn(new String[] {"https://bobpay.com", "basic-card"}); List<ResolveInfo> services = new ArrayList<>(); ResolveInfo isBobPayReadyToPay = new ResolveInfo(); isBobPayReadyToPay.serviceInfo = new ServiceInfo(); isBobPayReadyToPay.serviceInfo.packageName = "com.bobpay.app"; isBobPayReadyToPay.serviceInfo.name = "com.bobpay.app.IsReadyToWebPay"; services.add(isBobPayReadyToPay); Intent isReadyToPayIntent = new Intent(AndroidPaymentAppFinder.ACTION_IS_READY_TO_PAY); Mockito.when(packageManagerDelegate.getServicesThatCanRespondToIntent( ArgumentMatchers.argThat(new IntentArgumentMatcher(isReadyToPayIntent)))) .thenReturn(services); PackageInfo bobPayPackageInfo = new PackageInfo(); bobPayPackageInfo.versionCode = 10; bobPayPackageInfo.signatures = new Signature[1]; bobPayPackageInfo.signatures[0] = PaymentManifestVerifierTest.BOB_PAY_SIGNATURE; Mockito.when(packageManagerDelegate.getPackageInfoWithSignatures("com.bobpay.app")) .thenReturn(bobPayPackageInfo); PaymentManifestDownloader downloader = new PaymentManifestDownloader() { @Override public void initialize(WebContents webContents) {} @Override public void downloadPaymentMethodManifest(URI uri, ManifestDownloadCallback callback) { callback.onPaymentMethodManifestDownloadSuccess("some content here"); } @Override public void downloadWebAppManifest(URI uri, ManifestDownloadCallback callback) { callback.onWebAppManifestDownloadSuccess("some content here"); } @Override public void destroy() {} }; PaymentManifestParser parser = new PaymentManifestParser() { @Override public void parsePaymentMethodManifest(String content, ManifestParseCallback callback) { try { callback.onPaymentMethodManifestParseSuccess( new URI[] {new URI("https://bobpay.com/app.json")}, new URI[0], false); } catch (URISyntaxException e) { Assert.assertTrue(false); } } @Override public void parseWebAppManifest(String content, ManifestParseCallback callback) { WebAppManifestSection[] manifest = new WebAppManifestSection[1]; int minVersion = 10; manifest[0] = new WebAppManifestSection("com.bobpay.app", minVersion, PaymentManifestVerifierTest.BOB_PAY_SIGNATURE_FINGERPRINTS); callback.onWebAppManifestParseSuccess(manifest); } @Override public void createNative() {} @Override public void destroyNative() {} }; Set<String> methodNames = new HashSet<>(); methodNames.add("https://bobpay.com"); PaymentAppCreatedCallback callback = Mockito.mock(PaymentAppCreatedCallback.class); AndroidPaymentAppFinder.find(Mockito.mock(WebContents.class), methodNames, Mockito.mock(PaymentManifestWebDataService.class), downloader, parser, packageManagerDelegate, callback); Mockito.verify(callback).onPaymentAppCreated( ArgumentMatchers.argThat(Matches.paymentAppIdentifier("com.bobpay.app"))); Mockito.verify(callback).onAllPaymentAppsCreated(); } private static final class Matches implements ArgumentMatcher<PaymentApp> { private final String mExpectedAppIdentifier; private Matches(String expectedAppIdentifier) { mExpectedAppIdentifier = expectedAppIdentifier; } /** * Builds a matcher based on payment app identifier. * * @param expectedAppIdentifier The expected app identifier to match. * @return A matcher to use in a mock expectation. */ public static ArgumentMatcher<PaymentApp> paymentAppIdentifier( String expectedAppIdentifier) { return new Matches(expectedAppIdentifier); } @Override public boolean matches(PaymentApp app) { return app.getAppIdentifier().equals(mExpectedAppIdentifier); } } }
/* Copyright (C) 2021 Susi Lehtola This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "util.h" #define XC_MGGA_X_RPPSCAN 648 /* r++SCAN exchange */ typedef struct { double c2, d, k1, eta; } mgga_x_rppscan_params; #define N_PAR 4 static const char *names[N_PAR] = {"_c2", "_d", "_k1", "_eta"}; static const char *desc[N_PAR] = {"c2 parameter", "d parameter", "k1 parameter", "eta parameter"}; static const double par_rppscan[N_PAR] = {0.8, 1.24, 0.065, 0.001}; static void mgga_x_rppscan_init(xc_func_type *p) { assert(p!=NULL && p->params == NULL); p->params = libxc_malloc(sizeof(mgga_x_rppscan_params)); } #include "maple2c/mgga_exc/mgga_x_rppscan.c" #include "work_mgga.c" #ifdef __cplusplus extern "C" #endif const xc_func_info_type xc_func_info_mgga_x_rppscan = { XC_MGGA_X_RPPSCAN, XC_EXCHANGE, "r++SCAN: rSCAN with uniform density limit and coordinate scaling behavior", XC_FAMILY_MGGA, {&xc_ref_Furness2022_034109, NULL, NULL, NULL, NULL}, XC_FLAGS_3D | MAPLE2C_FLAGS, 1e-11, {N_PAR, names, desc, par_rppscan, set_ext_params_cpy}, mgga_x_rppscan_init, NULL, NULL, NULL, &work_mgga };
/** * This function is package private and is called by the public prepareFunctions. It requests a KeyExchangeProtocol that has not been implemented yet. * Does the same as the above prepareForCommunication function only sets the flag of enableNagle first. * * @param enableNagle a flag indicating weather or not to use the Nagle optimization algorithm * @return a set of connected and ready channels to be used by the parties to send and receive data, it may be null if none succeeded */ Map<InetSocketAddress, Channel> prepareForCommunication(List<Party> listOfParties, KeyExchangeProtocol keyExchange, ConnectivitySuccessVerifier successLevel, long timeOut, boolean enableNagle) { this.enableNagle = enableNagle; return prepareForCommunication(listOfParties, keyExchange, successLevel, timeOut); }
<filename>src/util/popup.ts<gh_stars>1-10 import { Injector, TemplateRef, ViewRef, ViewContainerRef, Renderer2, ComponentRef, ComponentFactoryResolver, ApplicationRef } from '@angular/core'; export class ContentRef { constructor(public nodes: any[], public viewRef?: ViewRef, public componentRef?: ComponentRef<any>) {} } export class PopupService<T> { private _windowRef: ComponentRef<T>; private _contentRef: ContentRef; constructor( private _type: any, private _injector: Injector, private _viewContainerRef: ViewContainerRef, private _renderer: Renderer2, private _componentFactoryResolver: ComponentFactoryResolver, private _applicationRef: ApplicationRef) {} open(content?: string | TemplateRef<any>, context?: any): ComponentRef<T> { if (!this._windowRef) { this._contentRef = this._getContentRef(content, context); this._windowRef = this._viewContainerRef.createComponent( this._componentFactoryResolver.resolveComponentFactory<T>(this._type), 0, this._injector, this._contentRef.nodes); } return this._windowRef; } close() { if (this._windowRef) { this._viewContainerRef.remove(this._viewContainerRef.indexOf(this._windowRef.hostView)); this._windowRef = null; if (this._contentRef.viewRef) { this._applicationRef.detachView(this._contentRef.viewRef); this._contentRef.viewRef.destroy(); this._contentRef = null; } } } private _getContentRef(content: string | TemplateRef<any>, context?: any): ContentRef { if (!content) { return new ContentRef([]); } else if (content instanceof TemplateRef) { const viewRef = content.createEmbeddedView(context); this._applicationRef.attachView(viewRef); return new ContentRef([viewRef.rootNodes], viewRef); } else { return new ContentRef([[this._renderer.createText(`${content}`)]]); } } }
main :: IO() main = do len <- getLine arr <- getLine let ans = compress arr 0 putStrLn $ show ans compress :: String -> Int -> Int compress [] a = a compress [x] a = a compress (x:y:ys) a | x == y = compress (y:ys) (a+1) | otherwise = compress (y:ys) a
package mysql_database import ( "fmt" "log" "os" "path/filepath" "time" "xorm.io/xorm" xorm_log "xorm.io/xorm/log" ) // SimpleLogger is the default implment of core.ILogger type fileLogger struct { *xorm_log.SimpleLogger } //var _ core.ILogger = &fileLogger{} func CheckMySQLEngine(_engine *xorm.Engine) bool { err := _engine.Ping() if err != nil { return false } return true } // newLogger let you customrize your logger prefix and flag func NewSqlFileLogger(_prefix string, _flag int) *fileLogger { return initLogger(_prefix, _flag, xorm_log.LOG_INFO) } // initLogger let you customrize your logger prefix and flag and logLevel func initLogger(_prefix string, _flag int, _logLevel xorm_log.LogLevel) *fileLogger { logger := &fileLogger{ SimpleLogger: &xorm_log.SimpleLogger{ DEBUG: log.New(nil, fmt.Sprintf("%s [DEBUG] ", _prefix), _flag), ERR: log.New(nil, fmt.Sprintf("%s [ERROR] ", _prefix), _flag), INFO: log.New(nil, fmt.Sprintf("%s [INFO] ", _prefix), _flag), WARN: log.New(nil, fmt.Sprintf("%s [WARN] ", _prefix), _flag), }, } logger.SimpleLogger.SetLevel(_logLevel) return logger } // Error implement core.ILogger func (fl *fileLogger) Error(_v ...interface{}) { fl.refreshOutput(fl.ERR) fl.SimpleLogger.Error(_v...) return } // ErrorF implement core.ILogger func (fl *fileLogger) Errorf(_format string, _v ...interface{}) { fl.refreshOutput(fl.ERR) fl.SimpleLogger.Errorf(_format, _v...) return } // Debug implement core.ILogger func (fl *fileLogger) Debug(_v ...interface{}) { fl.refreshOutput(fl.DEBUG) fl.SimpleLogger.Debug(_v...) return } // DebugF implement core.ILogger func (fl *fileLogger) Debugf(_format string, _v ...interface{}) { fl.refreshOutput(fl.DEBUG) fl.SimpleLogger.Debugf(_format, _v...) return } // Info implement core.ILogger func (fl *fileLogger) Info(_v ...interface{}) { fl.refreshOutput(fl.INFO) fl.SimpleLogger.Info(_v...) return } // InfoF implement core.ILogger func (fl *fileLogger) Infof(_format string, _v ...interface{}) { fl.refreshOutput(fl.INFO) fl.SimpleLogger.Infof(_format, _v...) return } // Warn implement core.ILogger func (fl *fileLogger) Warn(_v ...interface{}) { fl.refreshOutput(fl.WARN) fl.SimpleLogger.Warn(_v...) return } // WarnF implement core.ILogger func (fl *fileLogger) Warnf(_format string, _v ...interface{}) { fl.refreshOutput(fl.WARN) fl.SimpleLogger.Warnf(_format, _v...) return } func (fl *fileLogger) refreshOutput(_logger *log.Logger) { fileWriter := fl.newWriter() _logger.SetOutput(fileWriter) } func (fl *fileLogger) newWriter() *os.File { path, _ := filepath.Abs("./logs/db") _, err := os.Stat(path) if err != nil && os.IsNotExist(err) { _ = os.MkdirAll(path, os.ModePerm) } logFile := fmt.Sprintf("./logs/db/db_%s.log", time.Now().Format("20060102")) logFile, _ = filepath.Abs(logFile) fileWriter, _ := os.OpenFile(logFile, os.O_CREATE|os.O_WRONLY|os.O_APPEND, os.ModePerm) return fileWriter }
Rolling resistance contribution to a road pavement life cycle carbon footprint analysis Purpose Although the impact of road pavement surface condition on rolling resistance has been included in the life cycle assessment (LCA) framework of several studies in the last years, there is still a high level of uncertainty concerning the methodological assumptions and the parameters that can affect the results. In order to adopt pavement carbon footprint/LCA as a decision-making tool, it is necessary to explore the impact of the chosen methods and assumptions on the LCA results. Methods This paper provides a review of the main models describing the impact of the pavement surface properties on vehicle fuel consumption and analyses the influence of the methodological assumptions related to the rolling resistance on the LCA results. It compares the CO2 emissions, calculated with two different rolling resistance models existing in literature, and performs a sensitivity test on some specific input variables (pavement deterioration rate, traffic growth, and emission factors/fuel efficiency improvement). Results and discussion The model used to calculate the impact of the pavement surface condition on fuel consumption significantly affects the LCA results. The pavement deterioration rate influences the calculation in both models, while traffic growth and fuel efficiency improvement have a limited impact on the vehicle CO2 emissions resulting from the pavement condition contribution to rolling resistance. Conclusions and recommendations Existing models linking pavement condition to rolling resistance and hence vehicle emissions are not broadly applicable to the use phase of road pavement LCA and further research is necessary before a widely-used methodology can be defined. The methods of modelling and the methodological assumptions need to be transparent in the analysis of the impact of the pavement surface condition on fuel consumption, in order to be interpreted by decision makers and implemented in an LCA framework. This will be necessary before product category rules (PCR) for pavement LCA can be extended to include the use phase. Introduction Road transport accounts for the majority of greenhouse gas (GHG) emissions from transport in the UK and is a significant component of all UK greenhouse gas emissions. In 2009, UK total GHG emissions from transport were 165.8 Mt carbon dioxide equivalent (CO 2 e), accounting for 27 % of total UK GHG emissions, and road transport was the most significant source of emissions, accounting for 68 % of total transport GHG emissions (UK Department of Energy & Climate Change 2015). In order to reduce this impact, in the last years, highway authorities and a growing number of organizations, companies and government institutions are introducing sustainability principles and considerations in asset management decision-making processes, by using a systematic and organized approach, called life cycle assessment (LCA) (Korre and Durucan 2009), (Wayman et al. 2014). LCA is a structured methodology to estimate and quantify the environmental Responsible editor: Omer Tatari * Laura Trupia [email protected]; [email protected] impacts over the full life cycle of a product or system, Bfrom cradle to grave^, estimating direct and indirect impacts. For pavements, a typical life cycle includes material production, construction, use, maintenance and rehabilitation (M&R), and end of life (EOL) phases (Santero et al. 2011b;Wang et al. 2014) (see Fig. 1). The use phase is one of the most critical and complex parts of a road pavement LCA, requiring specific knowledge in disparate areas (Santero and Horvath 2009). During this phase, the environmental impact is affected by several complex mechanisms; rolling resistance, albedo, carbonation, lighting and leachate. For this reason and for the uncertainty that consequently characterizes it, it is hard to quantify the impact of this phase with a sufficient level of accuracy and in the past, it was generally omitted from the framework of many LCA studies (Santero et al. 2011a), (Santero et al. 2011b). This may be acceptable for standalone LCA studies (e.g. to estimate the environmental impacts of a paving material) but is a problem for comparative LCA studies where different use phase outcomes could result (e.g. where different materials or maintenance programmes will lead to different surface condition) (Butt et al. 2015). The use phase represents the longest phase in the life cycle of a pavement, remaining in service for decades (much longer than the construction phase), so it can have a significant environmental impact. In particular, it has been demonstrated that the impact of these components can span a very wide range of values (from negligible to significant), depending on different parameters (Santero and Horvath 2009). Among these components, the rolling resistance can have a dominating impact under certain conditions. The rolling resistance is the effort that the engine makes to keep the tyre rolling on the pavement. It represents the energy loss associated with the pavementvehicle interaction (PVI), due to the physical interaction between pavement and tyre and it is mainly caused by the viscoelastic properties of the rubber elements present in the tyre tread. Although much of the rolling resistance can be tracked to tyre properties, it is also affected by other parameters related to the characteristics of the pavement, such as the pavement surface properties, macrotexture-usually represented by parameters mean profile depth (MPD) or mean texture depth (MTD)-and unevenness or pavement roughness-typically measured by the International Roughness Index (IRI). Pavement surface properties affect rolling resistance that, acting opposite to the motion of the vehicle, increases the fuel consumption. An increase in traffic fuel consumption corresponds to a growth in environmental impact, due to the increase in emission of pollutants. Therefore, vehicle energy consumption and emissions are affected by pavement surface properties; however, quantifying the influence of the pavement surface condition on the rolling resistance is complex. Over the last years, some efforts have been made to assess the overall impact of the use phase, particularly PVI. However, there is still a high level of uncertainty concerning the lack of validated models used to analyse the vehicle emissions and the influence of specific variables and assumptions on the results. In order to obtain reliable results that can be interpreted by decision makers, it is necessary that methods of modelling and the assumptions adopted in LCA and carbon footprint studies are transparent. In addition, there are no significant researches involving UK case studies on the impact of the use phase on the life cycle of a pavement. By reducing the uncertainty concerning the estimation of this component, highway authorities, research organizations and other policymaking institutions can include pavement LCA in their decision-making framework with more confidence. This paper will analyse a UK case study to investigate the impact of extending the system boundary of road pavement LCA to include the emissions due to the effect of the pavement surface properties (IRI and MPD) on the rolling resistance. The main aim of this study is to explore if the understanding and the knowledge of this component are sufficient to be implemented in the road pavement LCA framework. The research questions are the as follows: Are rolling resistance models ready for implementation in a pavement LCA? Can they be applied to a UK case study? How do pavement deterioration and the models used to describe them affect the results? Based on the use of two different models present in the literature, this study will estimate the range of potential impact of the rolling resistance component, with a focus on the effect of the deterioration of pavement surface condition (IRI and MPD) on traffic fuel consumption and CO 2 emissions. By using different methodologies and making different assumptions regarding traffic growth, emission factors/fuel efficiency improvement and pavement surface condition deterioration rate, the sensitivity of the results to the different assumptions (Santero et al. 2011b) will be tested. This will allow the parameters that affect the environmental impact due to PVI rolling resistance and the magnitude of this effect to be estimated. 2 Brief literature review 2.1 Rolling resistance models The relationship between pavement properties, rolling resistance and vehicle fuel consumption has been an area of study for several years. However, the inclusion of this component in the LCA system boundary is quite recent and is mainly focused on the potential for pavement management practice to reduce the net life cycle emissions of a road over the life cycle of well-maintained pavements. In order to define the contribution of the rolling resistance, in terms of IRI and MPD, in the use phase of a pavement LCA framework, it is necessary to use both a rolling resistance model (relating rolling resistance to pavement surface properties) and an emission model (relating traffic fuel emissions to the rolling resistance). Starting from the 1980s, several rolling resistance measurement studies have been performed in Europe, to investigate the impact of pavement properties on rolling resistance and vehicle fuel consumption, by using different test methods (Sandberg et al. 2011b). Existing literature on the influence of road surface properties and vehicle rolling resistance, and hence emissions, presents differing results. This is due to a number of reasons: road surface contributions are a relatively small part of the driving resistance or of just the rolling resistance; it is difficult to isolate the road surface effects from other effects (i.e. tyres) and quantify the contribution of IRI and MPD; different methods of measuring rolling resistance can yield different results (Hammarström et al. 2012). Recently, different studies (Sandberg et al. 2011a;Willis et al. 2015) reviewed the most significant rolling resistance research around the world, drawing the following overall conclusions: -When the rolling resistance coefficient increases, the vehicle fuel consumption increases significantly, especially on roads with no gradient and at constant speed (typically high highway speed) (Bendtsen 2004). -The most significant pavement parameters affecting rolling resistance are macrotexture (MPD), or megatexture, unevenness or roughness (IRI) and stiffness. -Texture and unevenness affect the rolling resistance in a negative way; greater values of MPD and IRI correspond to greater rolling resistance. -For light vehicles, the impact of MPD is around three times that of the IRI effect. -The effect of roughness on rolling resistance can change with speed, while that of texture does not. -How stiffness affects PVI has not been consistently explained and is as yet, uncertain. Based on these conclusions, a model describing the pavement influence on rolling resistance should take into account MPD and IRI, while the impact of stiffness is not yet clear. Pavement unevenness and macrotexture are the deviations of a pavement surface from a true planar surface with the wavelengths of deviations ranging from 0.5 to 50 m, and from 0.5 to 50 mm, respectively (International Organization for Standardization (ISO) 2004). There are few models in the literature that have explored the combined effect of IRI and MPD: Highway Development and Management Model-version 4 (HDM-4) and the model developed by the Swedish National Road and Transport Research Institute (VTI), within the European Commission project Miriam (Models for rolling resistance In Road Infrastructure Asset Management systems). HDM-4 is an empirical-mechanistic model software tool developed by PIARC (World Road Association) to perform cost analysis for the maintenance and rehabilitation of roads (Kerali et al. 2000). It includes both a model for simulating rolling resistance from IRI and MPD and an engine model to link the effects of rolling resistance to vehicle fuel consumption. The mechanistic part of HDM-4 analyses all driving resistances on the engine, based on the vehicle speed and road gradient, while the empirical part uses coefficients which convert the driving resistances to energy consumption, determined through various experiments and calibrated with measured data. In 2011, the fuel consumption model was calibrated for US conditions as part of the NCHRP Project 1-45 (Chatti and Zaabar 2012). The results of this study showed that IRI and road gradient had a statistically significant relationship with fuel consumption at low and high speed, while macrotexture (MPD) was not statistically significant at high speed. This is contradictory to the observations of other studies, as described above. The authors explained this result by the fact that at higher speed, the air drag is the predominant component of the fuel consumption and minimizes the increase in rolling resistance due to macrotexture. In order to use HDM-4 as a road decision support tool in UK, the UK Department for Transport (DfT) and the University of Birmingham calibrated the model under English conditions (Odoki et al. 2013). Unfortunately, the calibration factors are not published. The VTI model, instead (Fig. 2), includes a general rolling resistance model and a fuel consumption model; the first is mainly based on empirical data from coastdown measurements in Sweden and incorporated into a driving resistance based fuel consumption model. The fuel consumption model has been calibrated based on calculated values from the computer program VETO, a theoretical model developed at VTI to calculate fuel consumption and exhaust emissions from traffic due to various characteristics of vehicles, roads and driving behaviour (Hammarström et al. 2012). The VTI model allows the calculation of the fuel consumption related to the pavement surface properties for a car, for a heavy truck and for a heavy truck with trailer, by using two different equations: the first one relates the rolling resistance to the surface properties of a pavement (IRI and MPD) (Eq.(1)); the second one expresses the fuel consumption as a function of the rolling resistance, speed and other road condition variables, such as gradient and horizontal curvature (Eq. (2)). Rolling resistance for a car: where m 1 is the vehicle mass (kg), v is the vehicle speed (m/s), IRI is the road roughness (m/km) and MPD is the macrotexture (mm). Fuel consumption function for a car: where ADC is the average degree of curvature (rad/km) and RF is the road gradient (m/km). LCA studies including the rolling resistance component As mentioned above, in the last years, some studies have started to include the impact of the pavement properties in the pavement LCA framework. Table 1 summarizes the major LCA studies, which include the effect of pavement surface condition on rolling resistance within the system boundary. The table shows that overall, there are just a few recent studies including the effect of both roughness and texture and they use the HDM-4 or the VTI models, described above. An interesting approach is the one developed by Wang et al. (Wang et al. 2012b(Wang et al. , 2014 at the University of California Pavement Research Center (UCPRC, Davis). In this model (Fig. 3), HDM-4 was used to estimate the rolling resistance and MOVES (Motor Vehicle Emission Simulator) (EPA's Office of Transportation and Air Quality (OTAQ) 2014) was used to model the vehicle emissions as a function of rolling resistance. In order to develop the equation function, the authors have modelled a series of IRI and MPD values for combinations of specific variables (pavement type, road type, road access type, vehicle type mix) using MOVES. The estimated emission factors depend on different variables, including the tyre rolling resistance represented by a default coefficient. This default value has been obtained through dynamometer tests on a smooth surface (usually steel or steel with a sand coating) and therefore, it only takes into account the influence of the tyre on the rolling resistance, neglecting the effect of the pavement properties. In order to calculate the emissions under different IRI and MPD conditions, the default rolling resistance coefficient has been updated in the MOVES database by using the formula adopted in the HDM-4 software that also includes the effect of the pavement properties on the rolling resistance (Wang et al. 2012a). The model developed with this approach is shown in Eq.(3): where T CO 2 is the tailpipe CO 2 emission factor; the terms a 1 , a 2 and Intercept are the coefficients derived from the linear regression, depending on surface type and access type, year and vehicle type; IRI is the road roughness (m/km) and MPD is the macrotexture (mm). In particular, the Intercept term represents the CO 2 emissions due to the total driving resistance, except the contribution of the pavement deterioration, estimated with the other two components. Parameters affecting the results of the rolling resistance component in LCA studies The use of all these models, correlating pavement surface properties to vehicle fuel consumption and emissions, requires the estimation of some parameters that can affect the final result, including the pavement condition deterioration rate with time (in terms of IRI and MPD), the traffic growth and the emission factors/fuel efficiency improvements. During the use phase of a road pavement, pavement deterioration leads to changes in unevenness and macrotexture that vary over time based on different variables, pavement material (asphalt or concrete), traffic volume and truck traffic, climate, pavement age and maintenance treatments (Wang et al. 2014). Roughness (IRI) tends to increase over time for a specific road but the variation of the texture depth (MPD) can be positive or negative, depending on several mechanisms. Unlike in the USA for instance, in the UK, new surfaces are generally produced with high initial texture depth to maintain highspeed skidding resistance and a reduction in texture depth over time is observed, especially in the more trafficked lanes. The rate of reduction depends on several variables; for instance, after a surface dressing, the embedment of chippings into the underlying layer, under the action of traffic, produces a rapid drop in the texture depth over the first 1 or 2 years. The final value that the texture depth reaches depends on the substrate of the surface dressing and the size of aggregate used for chippings. Other surfacing materials, like rolled asphalt, do not change so markedly during the first few years, but the average texture tends to reduce in subsequent years, at least in the more trafficked lanes (Jacobs 1982), (UK Goverment 1999). This type of behaviour has also been observed in other studies related to other European countries (Hammarström et al. 2012). Several studies have been performed in the UK in order to predict performance in terms of texture depth. In addition, the UK Roads Board has developed SCANNER (Surface Condition Assessment for the National Network of Roads) surveys, to provide a consistent method of measuring the surface condition (including ride quality, rut depth, intensity of cracking, texture depth and edge condition) (Transport Research Laboratory 2009). However, there are no general models in the UK able to predict the change of texture depth over time. Another important variable necessary to quantify the future level of traffic emissions is the traffic growth factor. It requires the understanding of how people make travel choices and the expected path of key drivers of travel demand. Recent studies (Masters 2015) have shown how in the UK the rates of traffic growth are consistently overestimated by the Department for Transport (see Fig. 4) and traffic congestion is a limiting factor for large traffic growth, so this parameter is an uncertain factor that could significantly impact the results. Finally, the emission factors and fuel consumption or efficiency improvements should be taken into account, in order to estimate future levels of emissions. This estimation is particularly complex, since it requires the prediction of future technological improvements, based on the announced government policy. In the UK, the Department for Transport's National Transport Model (NTM) has provided forecasts of CO 2 emission changes by vehicle type between 2010 and 2040, taking into account technological improvements in fuel type and efficiency (UK Department for Transport 2013a). Since a high level of uncertainty characterizes this area of knowledge, both in terms of available models Zaabar and Chatti (2010) and in terms of parameters affecting the results, this study aims to investigate the impact of the pavement surface properties (IRI and MPD) during the use phase, in terms of CO 2 emissions, by using two different models in the literature (VTI and UCPRC model) and performing a sensitivity analysis to investigate the variables and conditions that can have an impact. Case study The case study analysed in this paper is a 720-m section of road-200-m length of dual carriageway (typical width, 22 m) and 520-m length of single carriageway (typical width, 11 m)-located in Lincolnshire on the A17 between Sutton Bridge and Kings Lynn, an interurban road in the UK East Midlands. The annual average daily flow (AADF) in 2009 was 15,372 motor vehicles and 2412 HGVs, making this segment a low to medium trafficked road. The existence of previous studies focusing on the construction and maintenance phases of this road segment (Galatioto et al. 2015;Huang et al. 2013;Spray 2014) is one of the main reasons why it was chosen as a case study. This will allow a better understanding of the relative environmental impact and the magnitude of the use phase, in terms of rolling resistance impact, on the LCA of this case study, by comparing it with the construction and maintenance results. In addition, there is an appropriate level of information and data available on the history of construction and maintenance events and on the traffic flow, provided by Lincolnshire Highways Authority. Lastly, based on the UK road type classification, this is an 'A' road, a major road intended to provide large-scale transport links within or between areas (UK Department for Transport 2012). Motorways and major trunk A roads account for a small percentage of the UK road network in length, but they carry a large and consistently increasing amount of traffic. In 2014, major roads combined accounted for 13 % (1 % motorway and 12 % 'A' roads) of road length and carried 65 % of total road traffic in Great Britain (21 % motorway and 45 % 'A' roads), as has been the case over the past 10 years. (UK Department for Transport 2016). The original construction of this road segment dates back to 1989 followed by some minor maintenance treatments until 2009, when a major rehabilitation took place. The full depth reconstruction involved milling out of 150 mm of the old asphalt pavement and replacing with an inlay of new asphalt mixtures and the use of a proprietary reinforcing Gridseal system (composite asphalt reinforcement system (CRS)). The analysis period chosen for this case study is 20 years, starting in 2009 until 2029 when a future rehabilitation is assumed. Short analysis periods are more reliable in terms of predictions (e.g. traffic growth, vehicle technology evolution, maintenance strategies, etc.), since evolving performance expectations and demand create a high level of uncertainty over longer analysis periods. In other research involving this same case study, the impact of raw materials, construction and maintenance (but not traffic delay) phases have been investigated (Spray 2014), giving an estimate of 370 tCO 2 e for the 2009 reconstruction. In addition, a recent study, including the traffic emission's impact due to delays during maintenance works in 2009 (Galatioto et al. 2015), concluded that the impact of this component can span between 1.94 and 16.46 t of CO 2 (the greatest component of the vehicle tailpipe CO 2 e), depending on the traffic flow and the maintenance strategy adopted (Table 2). Methodology This study will estimate the additional GHG emissions from vehicle operation due to pavement surface properties and their deterioration for the case study section, by using two different models developed in literature (VTI and UCPRC models) and will conduct a sensitivity analysis on some factors influencing the results (traffic growth, pavement deterioration model and emission factors/fuel efficiency improvements). Since CO 2 is the greatest component of the vehicle tailpipe CO 2 e emissions (over 99.8 %) (Wang et al. 2014), other tailpipe emissions are not taken into account in this study. Figure 5 shows the outline of the process adopted. Calculation of the tailpipe CO 2 emissions with VTI and UCPRC model First, the time progression of pavement surface deterioration (IRI and MPD) is generated, according to literature data for specific M&R strategies (Jacobs 1982;UK Goverment 1999), (Aavik et al. 2013;Wang et al. 2014). In order to estimate the range of potential impact of the pavement deterioration during the use phase, different scenarios of deterioration of IRI and MPD for the same road segment are considered. In the UCPRC model, the vehicle CO 2 emission factors are estimated as a continuous function of MPD and IRI (Wang et al. 2014). The CO 2 emission factors for a specific vehicle type are calculated directly, based on the analysed pavement segment's MPD and IRI by using Eq. (3) and multiplying by the vehicle mileage travelled. The VTI model includes a general rolling resistance model (Eq. (1)) and a fuel consumption model (Eq. (2)) so that it is possible to estimate the contribution of the rolling resistance to the total driving resistance and hence vehicle fuel consumption (Hammarström et al. 2012) and then to convert it to CO 2 emissions, assuming the conversion process proposed by the International Carbon Bank & Exchange (ICBE) (2010). Since this paper is focused on estimating the impact of the pavement surface properties (IRI, MPD) that affect rolling resistance at the pavement-vehicle interface, for both models, only the CO 2 emissions directly related to these elements are taken into account in the results (the other terms of the equations are considered equal to zero). The two models allow the estimation of the total CO 2 emissions related to the pavement condition in terms of IRI and MPD (see Fig. 6), namely the total component (total area, representing the total CO 2 emissions related to the IRI and MPD), including the basic component (dark grey area, representing the value of emissions if the IRI and MPD remain constant over time-no deterioration) and the deterioration component (light grey area, equal to the difference between the first two and representing the emissions due to the deterioration of the pavement properties, in terms of IRI and MPD). The deterioration component is particularly interesting for pavement engineering, since it is possible to reduce these emissions associated with the road surface condition, through 5 Outline of the process adopted in this study appropriate maintenance strategies. Pavement condition improvements can be obtained rapidly to reduce traffic fuel consumption, even using available technology. On the other hand, approaches that involve technology improvements or traffic reductions can require long periods of time. In order to better understand the behaviour of the two PVI emission models and the impact of the pavement deterioration assumptions, these components were assessed in a sensitivity analysis. Once the results in terms of CO 2 emissions are obtained from both models, it is possible to compare them, in order to understand the potential impact of the model used on the pavement LCA results. Furthermore, in order to identify the parameters that most affect results in the use phase, a sensitivity analysis is performed for the following variables: traffic growth, IRI and MPD time progression and vehicle fuel emission factors. Sensitivity test -Traffic growth model The AADF data for this study is extracted from the traffic dataset provided by the UK Department for Transport (UK Department for Transport 2014), where the vehicle data is classified based on the area, the year and the vehicle type. In order to quantify the impact of pavement surface properties on the use phase, it is necessary to estimate the future AADF, using a growth factor. This was estimated using TEMPRO (Trip End Model Presentation Program) (UK Department for Transport 2013b), a tool developed by the UK Department for Transport that analyses local data and, used in conjunction with national or regional traffic growth forecasts, provides local traffic projection factors. Since traffic growth is an uncertain factor, the sensitivity test performed for this variable took into account three different scenarios: the first one includes the estimated traffic growth projections (average), the second assumes no traffic growth during the analysis period (no), and the third one, a further increase of the traffic growth projections of 10 % (average + 10 %). The traffic growth factor was assumed to evolve linearly over the lifetime of the pavement. -Pavement deterioration In the literature, there are some empirical models calibrated for specific areas and maintenance treatments, to describe the deterioration rate of IRI and MPD. However, these models are site specific and not applicable to this case study (in these models, the value of MPD tends to increase over time, which is not typical in the UK). Since the focus of this study is on estimating the range of potential impact, the time progression of IRI and MPD on the assessed road segment over the analysis period (20 years) is generated according to literature data for specific M&R strategies (Aavik et al. 2013;Jacobs 1982;UK Goverment 1999;Wang et al. 2014) and by taking into account the following scenarios: -'average' deterioration scenario (IRI increases from 1.0 to 2.3 m/km and MPD decreases from 1.8 to 0.8 mm); -'worst' deterioration scenario (IRI increases from 1.0 to 5.0 m/km and MPD is 1.5 mm during all the analysis period). -'no deterioration' scenario where the surface pavement condition is unchanged over time (IRI = 1.0 m/km and MPD = 1.5 mm). -Emission factor or fuel efficiency improvement In order to test the sensitivity of the main inputs to the two models, different scenarios of variation of the emission factors in the UCPRC model and fuel efficiency in the VTI model will be considered. In the UCPRC model, changing the emission factors based on the MOVES software (that result in the coefficients a 1 , a 2 and Intercept of the linear regression, developed in Wang et al. (2014)) will be assessed. These factors change year by year based on predictions of future fuel economy and new vehicle technologies (e.g. electric vehicles). In the VTI model, changing the fuel efficiency will be tested, by using road emission projections resulting from the Department for Transport's National Transport Model (NTM) (UK Department for Transport 2013a). Again, in order to assess the sensitivity of the results to the emission factor forecast, three different scenarios are considered over the analysis period: emission factors and fuel efficiency constant (no); emission factors reduction and fuel efficiency increase, based on MOVES and NTM projections (average); and further variation of 10 % in emission factors reduction and fuel efficiency increase based on MOVES and NTM projections (average + 10 %). Based on the different assumptions made for the traffic growth, pavement deterioration and emission factors/fuel efficiency, different cases are analysed and compared. The traffic growth and the pavement deterioration during the analysis period tend to increase the CO 2 emissions, while the emission factor reduction affects the results in the opposite way, as vehicles become more fuel efficient. Results In order to evaluate the results, two baseline case scenarios have been defined (Table 3): the base case scenario to compare the results from two rolling resistance models and the average case scenario to compare the results of the sensitivity test (based on the different assumptions made for the traffic growth, pavement deterioration and emission factors/fuel efficiency). Table 4 summarizes the life cycle CO 2 emissions for the pavement case study analysed. As already described, since CO 2 is over 99.8 % of the vehicle tailpipe CO 2 e emissions, other tailpipe emissions are not taken into account for the traffic delay and for the use phase. For the use phase, the table shows the results obtained by using the two rolling resistance models, taking into account the total emissions and the deterioration component of the base case scenario (no traffic growth, no emission factor changes and average pavement deterioration). The UCPRC results show that, overall, the impact of the pavement surface properties on the life cycle of the case study-compared to the construction phase-is significantly higher, if the total emissions are considered (1387 tCO 2 vs 370 tCO 2 e), and of the same order of magnitude, if only the deterioration is considered (217 tCO 2 vs 370 tCO 2 e). In the VTI model, on the other hand, the total emissions are more than one order of magnitude higher than the construction phase (9672 tCO 2 vs 370 tCO 2 e) and the deterioration component is a negative term (−600 tCO 2 ). Clearly, the two models provide considerably different results, both in terms of the general contribution of the pavement surface properties to the rolling resistance (basic component) and in terms of the impact of the different components (IRI and MPD). These differences are due to different factors. The two models were calibrated for different countries, by using different background data (weather, vehicles, and roads) and they use two different approaches. The UCPRC model yields directly the PVI CO 2 emissions related to a specific pavement type, road type (and speed), road access type and vehicle type mix. The coefficients in the model take into account improvements in vehicle technology and the reduction of the emission factors over time. In the VTI model, instead, it is possible to calculate the fuel consumption related to a specific type of vehicle at a specific speed (and the IRI term is directly correlated to the speed). This requires the conversion of the fuel consumption into CO 2 emissions, by using specific conversion factors for fuel that do not take into account the vehicle age and technology. The negative term related to the deterioration component is a result of the different weight given to the IRI and MPD terms (see Fig. 7 and Fig. 8). In the VTI model, even at high speed (that increases the impact of the IRI), the MPD term has a larger impact on the emission estimate. In the UCPRC model, the IRI term has a larger impact. This difference has a large impact on results for pavement surfaces where the IRI tends to increase and the MPD tends to decrease, as for this case study. In the VTI model, the MPD term tends to decrease faster than the IRI term increases, providing a negative result for the deterioration component. The results show that the choice of model used to estimate the CO 2 emissions related to the pavement surface properties and the deterioration model are instrumental, since the different models give very different results. Table 5 and Table 6 show the results of the sensitivity tests for the variables: traffic growth, IRI and MPD deterioration rate, emission factors or fuel efficiency. By evaluating the best and the worst case scenarios for the two different models and considering the impact on the basic, deterioration and total components of vehicle CO 2 emissions, the sensitivity analysis shows the following: Sensitivity analysis for both models, the potential emissions due to PVI rolling resistance have a large range of values; this is particularly so in the deterioration component, especially in the VTI model, where the CO 2 emissions can vary between 0.80 and 7.38 times the average value; the best case scenario (lowest emissions) occurs under different assumptions for the two models (no deterioration in the UCPRC model and average deterioration in the VTI model). In the UCPRC model, the deterioration component increases over time, so the absence of deterioration minimizes the total emissions. In the VTI model, the deterioration component, under the average condition of pavement deterioration, tends to decrease, producing an overall reduction in the calculated emissions.Thiseffectlevelsoffunderthe'worstdeterioration' pavement condition, when the IRI effect is larger than the MPD effect. To better understand the impact of the different variables, Fig. 9 and Fig. 10 show a comparison between the average case scenario and six other scenarios where, in their turn, only one parameter is changed between its minimum and maximum value. The deterioration component remains between 14 and 16 %-in the UCPRC model-and between −5 and −8 %-in the VTI model-of the total component in each case, with the exception of the worst deterioration scenario, especially in the UCPRC model (around 50 % of the total component). This implies that the traffic growth and the emission factors/fuel economy changes do not significantly affect the results, either in terms of the basic component or in terms of the deterioration component, at least for this case study (only in the VTI model does a large increase of the traffic level produce a moderate impact on emissions). This is because while the traffic growth during the analysis period tends to increase the CO 2 emissions, the emission factor reduction affects the results in the opposite way, as vehicles become more fuel efficient. Therefore, even if the traffic growth and the emission factor parameters affect the results, this combined impact is not significant overall. By contrast, the CO 2 In both models, the CO 2 emissions are significantly higher in the case of the worst pavement deterioration scenario. This result agrees with other works (Araújo et al. 2014;Wang et al. 2012aWang et al. , 2014) that show how optimized maintenance strategies aimed at reducing pavement deterioration over time and the use of suitable materials can have a significant influence on vehicle CO 2 emissions during the use phase of a pavement. Discussion Based on the use of two different models, this paper assessed the impact of pavement surface deterioration during the use phase of a specific UK road pavement case study, with the objective of estimating the overall impact of this component on life cycle CO 2 emissions and the parameters that can affect the results. This makes it possible to define future research needs in this area and to understand the level of confidence possible in decision making using pavement LCA results. The results agree with previous studies in the literature (Santero and Horvath 2009;Wang et al. 2012b), showing that the pavement surface properties (IRI and MPD) have a significant impact during the life cycle of the pavement, compared to the other phases (370 t of CO 2 for the reconstruction phase and between 1.94 and 16.46 t of CO 2 for the traffic delay phase); the CO 2 emissions related to this component are significant both for the deterioration component (between −600 and 217 t of CO 2 ) and the total component (between 1170 and 10,272 t of CO 2 ). However, the results obtained using the two models are significantly different, both considering the basic component of emissions due to PVI rolling resistance (not affected by the pavement surface deterioration) and the deterioration component. These considerable differences are due to the fact that the development of rolling resistance and fuel consumption models is strongly affected by methodological components (such as different rolling resistance measuring methods, road surface measures, approach used to develop the models) and by site-specific components (weather, vehicle types and technology, type of roads, pavement design models and deterioration). The UCPRC model was developed in California, using the HDM-4 model calibrated for US conditions and MOVES, the US EPA highway vehicle emission model based on national data. The VTI model developed in Sweden includes a rolling resistance model based on empirical data and a fuel consumption model calibrated using calculated values from VETO, a theoretical model. California and Sweden are geographical locations characterized by different climates, types of roads, pavement deterioration processes and models, traffic distribution and technology, that seriously affect the models developed and the results produced. The two models consider the impact of the pavement surface properties, IRI and MPD, in different ways. In the UCPRC model, the IRI has a larger impact on the rolling resistance than the MPD and the opposite consideration is true for the VTI model. This difference is particularly significant in this case study, where the MPD falls over time, producing opposite results when the two models are used; in the UCPRC model, the deterioration component is positive, since the impact of the increase in IRI is larger than that due to the reduction in MPD, while for the VTI model, the deterioration component is negative. Therefore, the pavement condition deterioration over time has a strong impact on the rolling resistance, significantly affecting the results. This is confirmed by the sensitivity test performed on the IRI and MPD deterioration rate that showed that the CO 2 emissions due to PVI rolling resistance are very sensitive to this factor. By contrast, in this case study with low to medium traffic, traffic growth and the emission factors/fuel economy changes do not have a large impact on the results, because they tend to offset each other. Butt et al. (2015) discuss the use of attributional and consequential LCA studies for road pavements, where environmental impacts are attributed to products or actions, or the consequences or relative changes of making different decisions are estimated, respectively. These types of study can be used to estimate impacts in standalone studies of a single material or process, or in comparative studies of different choices. The two models used in this study use different approaches, described above, and this results in significantly different findings, which reduces confidence in their use for all types of LCA study, which will all be sensitive to the model chosen. Traffic growth and future changes in vehicle fuel efficiency and fuel types can be expected to have a significant impact on future emissions from road transport. Current predictions for the UK mean that these factors offset each other and combine to have little effect on the results for this case study. This means that the results of UK pavement LCA studies are not very sensitive to these factors. However, considering one factor without the other will distort the results and changes in the forecasts for these factors need to be monitored and studies updated to reflect them. The potential impact of the factors explored in this study on the results of pavement LCA including the use phase is significant. For this reason, LCA practitioners should be careful to report the models and assumptions they use in a detailed and transparent way (Huang and Parry 2014). Development of widely accepted approaches and agreement to use and declare them is a prerequisite for the development of LCA practice in this domain. Conclusions and recommendations The main aim of this paper was to investigate if current models of the impact of pavement surface properties on rolling resistance can be implemented in road pavement LCA. Considering the significant impact that the pavement surface properties can have during the life cycle of a road, it is necessary that any model used to estimate this component leads to results that can be used with confidence in the decision-making process. Taking into account the results obtained in the selected case study, the use of the UCPRC and VTI models in the UK should be treated with caution because they produce significantly different results. Further and different case studies are needed before it can be decided where they can be used. The different weight that the models give to the different pavement condition variables means the relative results from the two models are very sensitive to both level of pavement condition and its deterioration rate. This will have an impact both on stand-alone and comparative LCA studies. For UK roads, there is currently insufficient information available to predict the deterioration of roughness and texture depth over time depending on maintenance treatments, traffic volume, surface properties and materials. This must be corrected before pavement LCA studies can be extended to the use phase. Traffic growth and the emission factors/fuel efficiency predictions, combined to predict future vehicle emissions, have a relatively small effect because they cancel out to a large extent. Changes in predicted future traffic levels or emission factors could change this result and should be kept under review. Further research is necessary before the effect of the rolling resistance can be introduced in the pavement LCA framework with confidence. In particular, for UK roads, research is needed to develop reliable pavement deterioration models and PVI rolling resistance models, before introducing this component. LCA and carbon footprint studies need to be reported in a way that makes the methods of modelling and the assumptions used transparent, before they can be interpreted by decision makers. Standard models and procedures should be developed in the pavement LCA field to make this possible and are needed before product category rules in this domain can be extended to include the use phase.
<filename>main_helpers.h /** * @file main_helpers.h * @brief A couple of small functions needed in the main DMRG file * * @author <NAME> * @author <NAME> * @date $Date$ * * $Revision$ */ #ifndef MAIN_HELPERS_H #define MAIN_HELPERS_H #include<iostream> /** * @brief A function to calculate the minimum size of the enviroment * * @param m the number of states you are keeping * @param numberOfSites the number of sites in the whole chain * * When you are sweeping there is no need to go to very small environment * size because you can solve exactly when the environment is small * enough. */ inline double calculateMinEnviromentSize(int m, int numberOfSites) { int result; for (result=3; result<numberOfSites; result++) if (powf(2.0,result) >= 2.0*m) break; return result; } /** * @brief A function to print the energy in a fancy way * * Just prints the thing: sites in the left block, sites in the right * block, and energy per site */ inline void printGroundStateEnergy(int sitesInLeft, int sitesInRight, double groundStateEnergy) { std::cout<<std::setprecision(16); std::cout<<sitesInLeft<<" "<<sitesInRight\ <<" "<<groundStateEnergy/(sitesInLeft+sitesInRight)<<std::endl; } #endif //MAIN_HELPERS_H
/* $Id: UIMachineLogic.cpp 71374 2018-03-19 15:19:12Z vboxsync $ */ /** @file * VBox Qt GUI - UIMachineLogic class implementation. */ /* * Copyright (C) 2010-2017 Oracle Corporation * * This file is part of VirtualBox Open Source Edition (OSE), as * available from http://www.virtualbox.org. This file is free software; * you can redistribute it and/or modify it under the terms of the GNU * General Public License (GPL) as published by the Free Software * Foundation, in version 2 as it comes in the "COPYING" file of the * VirtualBox OSE distribution. VirtualBox OSE is distributed in the * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. */ #ifdef VBOX_WITH_PRECOMPILED_HEADERS # include <precomp.h> #else /* !VBOX_WITH_PRECOMPILED_HEADERS */ /* Qt includes: */ # include <QDir> # include <QFileInfo> # include <QPainter> # include <QTimer> # include <QDateTime> # include <QImageWriter> # ifdef VBOX_WS_MAC # include <QMenuBar> # endif /* VBOX_WS_MAC */ # ifdef VBOX_WS_X11 # include <QX11Info> # endif /* VBOX_WS_X11 */ /* GUI includes: */ # include "QIFileDialog.h" # include "UIActionPoolRuntime.h" # ifdef VBOX_GUI_WITH_NETWORK_MANAGER # include "UINetworkManager.h" # include "UIDownloaderAdditions.h" # endif /* VBOX_GUI_WITH_NETWORK_MANAGER */ # include "UIIconPool.h" # include "UIKeyboardHandler.h" # include "UIMouseHandler.h" # include "UIMachineLogic.h" # include "UIMachineLogicFullscreen.h" # include "UIMachineLogicNormal.h" # include "UIMachineLogicSeamless.h" # include "UIMachineLogicScale.h" # include "UIFrameBuffer.h" # include "UIMachineView.h" # include "UIMachineWindow.h" # include "UISession.h" # include "VBoxGlobal.h" # include "UIMessageCenter.h" # include "UIPopupCenter.h" # include "UISettingsDialogSpecific.h" # include "UITakeSnapshotDialog.h" # include "UIVMLogViewerDialog.h" # include "UIConverter.h" # include "UIModalWindowManager.h" # include "UIMedium.h" # include "UIExtraDataManager.h" # include "UIAddDiskEncryptionPasswordDialog.h" # include "UIVMInformationDialog.h" # ifdef VBOX_WS_MAC # include "DockIconPreview.h" # include "UIExtraDataManager.h" # endif /* VBOX_WS_MAC */ /* COM includes: */ # include "CAudioAdapter.h" # include "CVirtualBoxErrorInfo.h" # include "CMachineDebugger.h" # include "CSnapshot.h" # include "CDisplay.h" # include "CStorageController.h" # include "CMediumAttachment.h" # include "CHostUSBDevice.h" # include "CUSBDevice.h" # include "CVRDEServer.h" # include "CSystemProperties.h" # include "CHostVideoInputDevice.h" # include "CEmulatedUSB.h" # include "CNetworkAdapter.h" # ifdef VBOX_WS_MAC # include "CGuest.h" # endif /* VBOX_WS_MAC */ /* Other VBox includes: */ # include <iprt/path.h> # include <iprt/thread.h> # ifdef VBOX_WITH_DEBUGGER_GUI # include <VBox/dbggui.h> # include <iprt/ldr.h> # endif /* VBOX_WITH_DEBUGGER_GUI */ #endif /* !VBOX_WITH_PRECOMPILED_HEADERS */ /* VirtualBox interface declarations: */ #ifndef VBOX_WITH_XPCOM # include "VirtualBox.h" #else /* !VBOX_WITH_XPCOM */ # include "VirtualBox_XPCOM.h" #endif /* VBOX_WITH_XPCOM */ #ifdef VBOX_WS_MAC # include "DarwinKeyboard.h" #endif /* VBOX_WS_MAC */ #ifdef VBOX_WS_WIN # include "WinKeyboard.h" #endif /* VBOX_WS_WIN */ #ifdef VBOX_WS_X11 # include <XKeyboard.h> #endif /* VBOX_WS_X11 */ #define VBOX_WITH_REWORKED_SESSION_INFORMATION /* Define for reworked session-information window: */ struct USBTarget { USBTarget() : attach(false), id(QString()) {} USBTarget(bool fAttach, const QString &strId) : attach(fAttach), id(strId) {} bool attach; QString id; }; Q_DECLARE_METATYPE(USBTarget); /** Describes enumerated webcam item. */ struct WebCamTarget { WebCamTarget() : attach(false), name(QString()), path(QString()) {} WebCamTarget(bool fAttach, const QString &strName, const QString &strPath) : attach(fAttach), name(strName), path(strPath) {} bool attach; QString name; QString path; }; Q_DECLARE_METATYPE(WebCamTarget); /* static */ UIMachineLogic* UIMachineLogic::create(QObject *pParent, UISession *pSession, UIVisualStateType visualStateType) { UIMachineLogic *pLogic = 0; switch (visualStateType) { case UIVisualStateType_Normal: pLogic = new UIMachineLogicNormal(pParent, pSession); break; case UIVisualStateType_Fullscreen: pLogic = new UIMachineLogicFullscreen(pParent, pSession); break; case UIVisualStateType_Seamless: pLogic = new UIMachineLogicSeamless(pParent, pSession); break; case UIVisualStateType_Scale: pLogic = new UIMachineLogicScale(pParent, pSession); break; case UIVisualStateType_Invalid: case UIVisualStateType_All: break; /* Shut up, MSC! */ } return pLogic; } /* static */ void UIMachineLogic::destroy(UIMachineLogic *pWhichLogic) { delete pWhichLogic; } void UIMachineLogic::prepare() { /* Prepare required features: */ prepareRequiredFeatures(); /* Prepare session connections: */ prepareSessionConnections(); /* Prepare action groups: * Note: This has to be done before prepareActionConnections * cause here actions/menus are recreated. */ prepareActionGroups(); /* Prepare action connections: */ prepareActionConnections(); /* Prepare other connections: */ prepareOtherConnections(); /* Prepare handlers: */ prepareHandlers(); /* Prepare menu: */ prepareMenu(); /* Prepare machine-window(s): */ prepareMachineWindows(); #ifdef VBOX_WS_MAC /* Prepare dock: */ prepareDock(); #endif /* VBOX_WS_MAC */ #if 0 /* To early! The debugger needs a VM handle to work. So, must be done after power on. Moved to initializePostPowerUp. */ #ifdef VBOX_WITH_DEBUGGER_GUI /* Prepare debugger: */ prepareDebugger(); #endif /* VBOX_WITH_DEBUGGER_GUI */ #endif /* Load settings: */ loadSettings(); /* Retranslate logic part: */ retranslateUi(); } void UIMachineLogic::cleanup() { /* Save settings: */ saveSettings(); #ifdef VBOX_WITH_DEBUGGER_GUI /* Cleanup debugger: */ cleanupDebugger(); #endif /* VBOX_WITH_DEBUGGER_GUI */ #ifdef VBOX_WS_MAC /* Cleanup dock: */ cleanupDock(); #endif /* VBOX_WS_MAC */ /* Cleanup menu: */ cleanupMenu(); /* Cleanup machine-window(s): */ cleanupMachineWindows(); /* Cleanup handlers: */ cleanupHandlers(); /* Cleanup action connections: */ cleanupActionConnections(); /* Cleanup action groups: */ cleanupActionGroups(); /* Cleanup session connections: */ cleanupSessionConnections(); } void UIMachineLogic::initializePostPowerUp() { #ifdef VBOX_WITH_DEBUGGER_GUI prepareDebugger(); #endif sltMachineStateChanged(); sltAdditionsStateChanged(); sltMouseCapabilityChanged(); } UIActionPool* UIMachineLogic::actionPool() const { return uisession()->actionPool(); } CSession& UIMachineLogic::session() const { return uisession()->session(); } CMachine& UIMachineLogic::machine() const { return uisession()->machine(); } CConsole& UIMachineLogic::console() const { return uisession()->console(); } CDisplay& UIMachineLogic::display() const { return uisession()->display(); } CGuest& UIMachineLogic::guest() const { return uisession()->guest(); } CMouse& UIMachineLogic::mouse() const { return uisession()->mouse(); } CKeyboard& UIMachineLogic::keyboard() const { return uisession()->keyboard(); } CMachineDebugger& UIMachineLogic::debugger() const { return uisession()->debugger(); } const QString& UIMachineLogic::machineName() const { return uisession()->machineName(); } UIMachineWindow* UIMachineLogic::mainMachineWindow() const { /* Null if machine-window(s) not yet created: */ if (!isMachineWindowsCreated()) return 0; /* First machine-window by default: */ return machineWindows().value(0); } UIMachineWindow* UIMachineLogic::activeMachineWindow() const { /* Null if machine-window(s) not yet created: */ if (!isMachineWindowsCreated()) return 0; /* Check if there is an active window present: */ for (int i = 0; i < machineWindows().size(); ++i) { UIMachineWindow *pIteratedWindow = machineWindows()[i]; if (pIteratedWindow->isActiveWindow()) return pIteratedWindow; } /* Main machine-window by default: */ return mainMachineWindow(); } void UIMachineLogic::adjustMachineWindowsGeometry() { /* By default, the only thing we need is to * adjust machine-view size(s) if necessary: */ foreach(UIMachineWindow *pMachineWindow, machineWindows()) pMachineWindow->adjustMachineViewSize(); } void UIMachineLogic::sendMachineWindowsSizeHints() { /* By default, the only thing we need is to * send machine-view(s) size-hint(s) to the guest: */ foreach(UIMachineWindow *pMachineWindow, machineWindows()) pMachineWindow->sendMachineViewSizeHint(); } #ifdef VBOX_WS_MAC void UIMachineLogic::updateDockIcon() { if (!isMachineWindowsCreated()) return; if ( m_fIsDockIconEnabled && m_pDockIconPreview) if(UIMachineView *pView = machineWindows().at(m_DockIconPreviewMonitor)->machineView()) if (CGImageRef image = pView->vmContentImage()) { m_pDockIconPreview->updateDockPreview(image); CGImageRelease(image); } } void UIMachineLogic::updateDockIconSize(int screenId, int width, int height) { if (!isMachineWindowsCreated()) return; if ( m_fIsDockIconEnabled && m_pDockIconPreview && m_DockIconPreviewMonitor == screenId) m_pDockIconPreview->setOriginalSize(width, height); } UIMachineView* UIMachineLogic::dockPreviewView() const { if ( m_fIsDockIconEnabled && m_pDockIconPreview) return machineWindows().at(m_DockIconPreviewMonitor)->machineView(); return 0; } #endif /* VBOX_WS_MAC */ void UIMachineLogic::detach() { /* Enable 'manual-override', * preventing automatic Runtime UI closing: */ setManualOverrideMode(true); /* Was the step successful? */ bool fSuccess = true; LogRel(("GUI: Passing request to detach UI from machine-logic to UI session.\n")); fSuccess = uisession()->detach(); /* Manually close Runtime UI: */ if (fSuccess) closeRuntimeUI(); } void UIMachineLogic::saveState() { /* Enable 'manual-override', * preventing automatic Runtime UI closing: */ setManualOverrideMode(true); /* Was the step successful? */ bool fSuccess = true; /* If VM is not paused, we should pause it: */ bool fWasPaused = uisession()->isPaused(); if (fSuccess && !fWasPaused) fSuccess = uisession()->pause(); /* Save-state: */ if (fSuccess) { LogRel(("GUI: Passing request to save VM state from machine-logic to UI session.\n")); fSuccess = uisession()->saveState(); } /* Disable 'manual-override' finally: */ setManualOverrideMode(false); /* Manually close Runtime UI: */ if (fSuccess) closeRuntimeUI(); } void UIMachineLogic::shutdown() { /* Warn the user about ACPI is not available if so: */ if (!console().GetGuestEnteredACPIMode()) return popupCenter().cannotSendACPIToMachine(activeMachineWindow()); /* Shutdown: */ uisession()->shutdown(); } void UIMachineLogic::powerOff(bool fDiscardingState) { /* Enable 'manual-override', * preventing automatic Runtime UI closing: */ setManualOverrideMode(true); /* Was the step successful? */ bool fSuccess = true; /* Power-off: */ bool fServerCrashed = false; LogRel(("GUI: Passing request to power VM off from machine-logic to UI session.\n")); fSuccess = uisession()->powerOff(fDiscardingState, fServerCrashed) || fServerCrashed; /* Disable 'manual-override' finally: */ setManualOverrideMode(false); /* Manually close Runtime UI: */ if (fSuccess) closeRuntimeUI(); } void UIMachineLogic::closeRuntimeUI() { /* First, we have to hide any opened modal/popup widgets. * They then should unlock their event-loops asynchronously. * If all such loops are unlocked, we can close Runtime UI: */ QWidget *pWidget = QApplication::activeModalWidget() ? QApplication::activeModalWidget() : QApplication::activePopupWidget() ? QApplication::activePopupWidget() : 0; if (pWidget) { /* First we should try to close this widget: */ pWidget->close(); /* If widget rejected the 'close-event' we can * still hide it and hope it will behave correctly * and unlock his event-loop if any: */ if (!pWidget->isHidden()) pWidget->hide(); /* Asynchronously restart this slot: */ QMetaObject::invokeMethod(this, "sltCloseRuntimeUI", Qt::QueuedConnection); return; } /* Asynchronously ask UISession to close Runtime UI: */ LogRel(("GUI: Passing request to close Runtime UI from machine-logic to UI session.\n")); QMetaObject::invokeMethod(uisession(), "sltCloseRuntimeUI", Qt::QueuedConnection); } void UIMachineLogic::notifyAbout3DOverlayVisibilityChange(bool fVisible) { /* If active machine-window is defined now: */ if (activeMachineWindow()) { /* Reinstall corresponding popup-stack according 3D overlay visibility status: */ popupCenter().hidePopupStack(activeMachineWindow()); popupCenter().setPopupStackType(activeMachineWindow(), fVisible ? UIPopupStackType_Separate : UIPopupStackType_Embedded); popupCenter().showPopupStack(activeMachineWindow()); } /* Notify other listeners: */ emit sigNotifyAbout3DOverlayVisibilityChange(fVisible); } void UIMachineLogic::sltHandleVBoxSVCAvailabilityChange() { /* Do nothing if VBoxSVC still availabile: */ if (vboxGlobal().isVBoxSVCAvailable()) return; /* Warn user about that: */ msgCenter().warnAboutVBoxSVCUnavailable(); /* Power VM off: */ LogRel(("GUI: Request to power VM off due to VBoxSVC is unavailable.\n")); powerOff(false); } void UIMachineLogic::sltChangeVisualStateToNormal() { uisession()->setRequestedVisualState(UIVisualStateType_Invalid); uisession()->changeVisualState(UIVisualStateType_Normal); } void UIMachineLogic::sltChangeVisualStateToFullscreen() { uisession()->setRequestedVisualState(UIVisualStateType_Invalid); uisession()->changeVisualState(UIVisualStateType_Fullscreen); } void UIMachineLogic::sltChangeVisualStateToSeamless() { uisession()->setRequestedVisualState(UIVisualStateType_Invalid); uisession()->changeVisualState(UIVisualStateType_Seamless); } void UIMachineLogic::sltChangeVisualStateToScale() { uisession()->setRequestedVisualState(UIVisualStateType_Invalid); uisession()->changeVisualState(UIVisualStateType_Scale); } void UIMachineLogic::sltMachineStateChanged() { /* Get machine state: */ KMachineState state = uisession()->machineState(); /* Update action groups: */ m_pRunningActions->setEnabled(uisession()->isRunning()); m_pRunningOrPausedActions->setEnabled(uisession()->isRunning() || uisession()->isPaused()); m_pRunningOrPausedOrStackedActions->setEnabled(uisession()->isRunning() || uisession()->isPaused() || uisession()->isStuck()); switch (state) { case KMachineState_Stuck: { /* Prevent machine-view from resizing: */ uisession()->setGuestResizeIgnored(true); /* Get log-folder: */ QString strLogFolder = machine().GetLogFolder(); /* Take the screenshot for debugging purposes: */ takeScreenshot(strLogFolder + "/VBox.png", "png"); /* How should we handle Guru Meditation? */ switch (gEDataManager->guruMeditationHandlerType(vboxGlobal().managedVMUuid())) { /* Ask how to proceed; Power off VM if proposal accepted: */ case GuruMeditationHandlerType_Default: { if (msgCenter().remindAboutGuruMeditation(QDir::toNativeSeparators(strLogFolder))) { LogRel(("GUI: User request to power VM off on Guru Meditation.\n")); powerOff(false /* do NOT restore current snapshot */); } break; } /* Power off VM silently: */ case GuruMeditationHandlerType_PowerOff: { LogRel(("GUI: Automatic request to power VM off on Guru Meditation.\n")); powerOff(false /* do NOT restore current snapshot */); break; } /* Just ignore it: */ case GuruMeditationHandlerType_Ignore: default: break; } break; } case KMachineState_Paused: case KMachineState_TeleportingPausedVM: { QAction *pPauseAction = actionPool()->action(UIActionIndexRT_M_Machine_T_Pause); if (!pPauseAction->isChecked()) { /* Was paused from CSession side: */ pPauseAction->blockSignals(true); pPauseAction->setChecked(true); pPauseAction->blockSignals(false); } break; } case KMachineState_Running: case KMachineState_Teleporting: case KMachineState_LiveSnapshotting: { QAction *pPauseAction = actionPool()->action(UIActionIndexRT_M_Machine_T_Pause); if (pPauseAction->isChecked()) { /* Was resumed from CSession side: */ pPauseAction->blockSignals(true); pPauseAction->setChecked(false); pPauseAction->blockSignals(false); } break; } case KMachineState_PoweredOff: case KMachineState_Saved: case KMachineState_Teleported: case KMachineState_Aborted: { /* If not in 'manual-override' mode: */ if (!isManualOverrideMode()) { /* VM has been powered off, saved, teleported or aborted. * We must close Runtime UI: */ if (vboxGlobal().isSeparateProcess()) { /* Hack: The VM process is terminating, so wait a bit to make sure that * the session is unlocked and the GUI process can save extradata * in UIMachine::cleanupMachineLogic. */ /** @todo Probably should wait for the session state change event. */ KSessionState sessionState = uisession()->session().GetState(); int c = 0; while ( sessionState == KSessionState_Locked || sessionState == KSessionState_Unlocking) { if (++c > 50) break; RTThreadSleep(100); sessionState = uisession()->session().GetState(); } } LogRel(("GUI: Request to close Runtime UI because VM is powered off already.\n")); closeRuntimeUI(); return; } break; } #ifdef VBOX_WS_X11 case KMachineState_Starting: case KMachineState_Restoring: case KMachineState_TeleportingIn: { /* The keyboard handler may wish to do some release logging on startup. * Tell it that the logger is now active. */ doXKeyboardLogging(QX11Info::display()); break; } #endif default: break; } #ifdef VBOX_WS_MAC /* Update Dock Overlay: */ updateDockOverlay(); #endif /* VBOX_WS_MAC */ } void UIMachineLogic::sltAdditionsStateChanged() { /* Update action states: */ LogRel3(("GUI: UIMachineLogic::sltAdditionsStateChanged: Adjusting actions availability according to GA state.\n")); actionPool()->action(UIActionIndexRT_M_View_T_GuestAutoresize)->setEnabled(uisession()->isGuestSupportsGraphics()); actionPool()->action(UIActionIndexRT_M_View_T_Seamless)->setEnabled(uisession()->isVisualStateAllowed(UIVisualStateType_Seamless) && uisession()->isGuestSupportsSeamless()); } void UIMachineLogic::sltMouseCapabilityChanged() { /* Variable falgs: */ bool fIsMouseSupportsAbsolute = uisession()->isMouseSupportsAbsolute(); bool fIsMouseSupportsRelative = uisession()->isMouseSupportsRelative(); bool fIsMouseSupportsMultiTouch = uisession()->isMouseSupportsMultiTouch(); bool fIsMouseHostCursorNeeded = uisession()->isMouseHostCursorNeeded(); /* For now MT stuff is not important for MI action: */ Q_UNUSED(fIsMouseSupportsMultiTouch); /* Update action state: */ QAction *pAction = actionPool()->action(UIActionIndexRT_M_Input_M_Mouse_T_Integration); pAction->setEnabled(fIsMouseSupportsAbsolute && fIsMouseSupportsRelative && !fIsMouseHostCursorNeeded); if (fIsMouseHostCursorNeeded) pAction->setChecked(true); } void UIMachineLogic::sltHidLedsSyncStateChanged(bool fEnabled) { m_fIsHidLedsSyncEnabled = fEnabled; } void UIMachineLogic::sltKeyboardLedsChanged() { /* Here we have to update host LED lock states using values provided by UISession: * [bool] uisession() -> isNumLock(), isCapsLock(), isScrollLock() can be used for that. */ if (!isHidLedsSyncEnabled()) return; /* Check if we accidentally trying to manipulate LEDs when host LEDs state was deallocated. */ if (!m_pHostLedsState) return; #if defined(VBOX_WS_MAC) DarwinHidDevicesBroadcastLeds(m_pHostLedsState, uisession()->isNumLock(), uisession()->isCapsLock(), uisession()->isScrollLock()); #elif defined(VBOX_WS_WIN) if (!winHidLedsInSync(uisession()->isNumLock(), uisession()->isCapsLock(), uisession()->isScrollLock())) { keyboardHandler()->winSkipKeyboardEvents(true); WinHidDevicesBroadcastLeds(uisession()->isNumLock(), uisession()->isCapsLock(), uisession()->isScrollLock()); keyboardHandler()->winSkipKeyboardEvents(false); } else LogRel2(("GUI: HID LEDs Sync: already in sync\n")); #else LogRelFlow(("UIMachineLogic::sltKeyboardLedsChanged: Updating host LED lock states does not supported on this platform.\n")); #endif } void UIMachineLogic::sltUSBDeviceStateChange(const CUSBDevice &device, bool fIsAttached, const CVirtualBoxErrorInfo &error) { /* Check if USB device have anything to tell us: */ if (!error.isNull()) { if (fIsAttached) popupCenter().cannotAttachUSBDevice(activeMachineWindow(), error, vboxGlobal().details(device), machineName()); else popupCenter().cannotDetachUSBDevice(activeMachineWindow(), error, vboxGlobal().details(device), machineName()); } } void UIMachineLogic::sltRuntimeError(bool fIsFatal, const QString &strErrorId, const QString &strMessage) { /* Preprocess known runtime error types: */ if (strErrorId == "DrvVD_DEKMISSING") return askUserForTheDiskEncryptionPasswords(); /* Show runtime error: */ msgCenter().showRuntimeError(console(), fIsFatal, strErrorId, strMessage); } #ifdef VBOX_WS_MAC void UIMachineLogic::sltShowWindows() { for (int i=0; i < machineWindows().size(); ++i) { UIMachineWindow *pMachineWindow = machineWindows().at(i); /* Dunno what Qt thinks a window that has minimized to the dock * should be - it is not hidden, neither is it minimized. OTOH it is * marked shown and visible, but not activated. This latter isn't of * much help though, since at this point nothing is marked activated. * I might have overlooked something, but I'm buggered what if I know * what. So, I'll just always show & activate the stupid window to * make it get out of the dock when the user wishes to show a VM. */ pMachineWindow->raise(); pMachineWindow->activateWindow(); } } #endif /* VBOX_WS_MAC */ void UIMachineLogic::sltGuestMonitorChange(KGuestMonitorChangedEventType, ulong, QRect) { LogRel(("GUI: UIMachineLogic: Guest-screen count changed\n")); /* Make sure all machine-window(s) have proper geometry: */ foreach (UIMachineWindow *pMachineWindow, machineWindows()) pMachineWindow->showInNecessaryMode(); #ifdef VBOX_WS_MAC /* Update dock: */ updateDock(); #endif } void UIMachineLogic::sltHostScreenCountChange() { LogRel(("GUI: UIMachineLogic: Host-screen count changed\n")); /* Make sure all machine-window(s) have proper geometry: */ foreach (UIMachineWindow *pMachineWindow, machineWindows()) pMachineWindow->showInNecessaryMode(); } void UIMachineLogic::sltHostScreenGeometryChange() { LogRel(("GUI: UIMachineLogic: Host-screen geometry changed\n")); /* Make sure all machine-window(s) have proper geometry: */ foreach (UIMachineWindow *pMachineWindow, machineWindows()) pMachineWindow->showInNecessaryMode(); } void UIMachineLogic::sltHostScreenAvailableAreaChange() { LogRel(("GUI: UIMachineLogic: Host-screen available-area changed\n")); /* Make sure all machine-window(s) have proper geometry: */ foreach (UIMachineWindow *pMachineWindow, machineWindows()) pMachineWindow->showInNecessaryMode(); } UIMachineLogic::UIMachineLogic(QObject *pParent, UISession *pSession, UIVisualStateType visualStateType) : QIWithRetranslateUI3<QObject>(pParent) , m_pSession(pSession) , m_visualStateType(visualStateType) , m_pKeyboardHandler(0) , m_pMouseHandler(0) , m_pRunningActions(0) , m_pRunningOrPausedActions(0) , m_pRunningOrPausedOrStackedActions(0) , m_pSharedClipboardActions(0) , m_pDragAndDropActions(0) , m_fIsWindowsCreated(false) , m_fIsManualOverride(false) #ifdef VBOX_WITH_DEBUGGER_GUI , m_pDbgGui(0) , m_pDbgGuiVT(0) #endif /* VBOX_WITH_DEBUGGER_GUI */ #ifdef VBOX_WS_MAC , m_fIsDockIconEnabled(true) , m_pDockIconPreview(0) , m_pDockPreviewSelectMonitorGroup(0) , m_pDockSettingsMenuSeparator(0) , m_DockIconPreviewMonitor(0) , m_pDockSettingMenuAction(0) #endif /* VBOX_WS_MAC */ , m_pHostLedsState(NULL) , m_fIsHidLedsSyncEnabled(false) , m_pLogViewerDialog(0) { } void UIMachineLogic::setMachineWindowsCreated(bool fIsWindowsCreated) { /* Make sure something changed: */ if (m_fIsWindowsCreated == fIsWindowsCreated) return; /* Special handling for 'destroyed' case: */ if (!fIsWindowsCreated) { /* We ask popup-center to hide corresponding popup-stack *before* the remembering new value * because we want UIMachineLogic::activeMachineWindow() to be yet alive. */ popupCenter().hidePopupStack(activeMachineWindow()); } /* Remember new value: */ m_fIsWindowsCreated = fIsWindowsCreated; /* Special handling for 'created' case: */ if (fIsWindowsCreated) { /* We ask popup-center to show corresponding popup-stack *after* the remembering new value * because we want UIMachineLogic::activeMachineWindow() to be already alive. */ popupCenter().setPopupStackType(activeMachineWindow(), visualStateType() == UIVisualStateType_Seamless ? UIPopupStackType_Separate : UIPopupStackType_Embedded); popupCenter().showPopupStack(activeMachineWindow()); } } void UIMachineLogic::addMachineWindow(UIMachineWindow *pMachineWindow) { m_machineWindowsList << pMachineWindow; } void UIMachineLogic::setKeyboardHandler(UIKeyboardHandler *pKeyboardHandler) { /* Set new handler: */ m_pKeyboardHandler = pKeyboardHandler; /* Connect to session: */ connect(m_pKeyboardHandler, SIGNAL(sigStateChange(int)), uisession(), SLOT(setKeyboardState(int))); } void UIMachineLogic::setMouseHandler(UIMouseHandler *pMouseHandler) { /* Set new handler: */ m_pMouseHandler = pMouseHandler; /* Connect to session: */ connect(m_pMouseHandler, SIGNAL(sigStateChange(int)), uisession(), SLOT(setMouseState(int))); } void UIMachineLogic::retranslateUi() { #ifdef VBOX_WS_MAC if (m_pDockPreviewSelectMonitorGroup) { const QList<QAction*> &actions = m_pDockPreviewSelectMonitorGroup->actions(); for (int i = 0; i < actions.size(); ++i) { QAction *pAction = actions.at(i); pAction->setText(QApplication::translate("UIActionPool", "Preview Monitor %1").arg(pAction->data().toInt() + 1)); } } #endif /* VBOX_WS_MAC */ /* Shared Clipboard actions: */ if (m_pSharedClipboardActions) { foreach (QAction *pAction, m_pSharedClipboardActions->actions()) pAction->setText(gpConverter->toString(pAction->data().value<KClipboardMode>())); } if (m_pDragAndDropActions) { foreach (QAction *pAction, m_pDragAndDropActions->actions()) pAction->setText(gpConverter->toString(pAction->data().value<KDnDMode>())); } } #ifdef VBOX_WS_MAC void UIMachineLogic::updateDockOverlay() { /* Only to an update to the realtime preview if this is enabled by the user * & we are in an state where the framebuffer is likely valid. Otherwise to * the overlay stuff only. */ KMachineState state = uisession()->machineState(); if (m_fIsDockIconEnabled && (state == KMachineState_Running || state == KMachineState_Paused || state == KMachineState_Teleporting || state == KMachineState_LiveSnapshotting || state == KMachineState_Restoring || state == KMachineState_TeleportingPausedVM || state == KMachineState_TeleportingIn || state == KMachineState_Saving || state == KMachineState_DeletingSnapshotOnline || state == KMachineState_DeletingSnapshotPaused)) updateDockIcon(); else if (m_pDockIconPreview) m_pDockIconPreview->updateDockOverlay(); } #endif /* VBOX_WS_MAC */ void UIMachineLogic::prepareRequiredFeatures() { #ifdef VBOX_WS_MAC # ifdef VBOX_WITH_ICHAT_THEATER /* Init shared AV manager: */ initSharedAVManager(); # endif /* VBOX_WITH_ICHAT_THEATER */ #endif /* VBOX_WS_MAC */ } void UIMachineLogic::prepareSessionConnections() { /* We should watch for VBoxSVC availability changes: */ connect(&vboxGlobal(), SIGNAL(sigVBoxSVCAvailabilityChange()), this, SLOT(sltHandleVBoxSVCAvailabilityChange())); /* We should watch for requested modes: */ connect(uisession(), SIGNAL(sigInitialized()), this, SLOT(sltCheckForRequestedVisualStateType()), Qt::QueuedConnection); connect(uisession(), SIGNAL(sigAdditionsStateChange()), this, SLOT(sltCheckForRequestedVisualStateType())); /* We should watch for console events: */ connect(uisession(), SIGNAL(sigMachineStateChange()), this, SLOT(sltMachineStateChanged())); connect(uisession(), SIGNAL(sigAdditionsStateActualChange()), this, SLOT(sltAdditionsStateChanged())); connect(uisession(), SIGNAL(sigMouseCapabilityChange()), this, SLOT(sltMouseCapabilityChanged())); connect(uisession(), SIGNAL(sigKeyboardLedsChange()), this, SLOT(sltKeyboardLedsChanged())); connect(uisession(), SIGNAL(sigUSBDeviceStateChange(const CUSBDevice &, bool, const CVirtualBoxErrorInfo &)), this, SLOT(sltUSBDeviceStateChange(const CUSBDevice &, bool, const CVirtualBoxErrorInfo &))); connect(uisession(), SIGNAL(sigRuntimeError(bool, const QString &, const QString &)), this, SLOT(sltRuntimeError(bool, const QString &, const QString &))); #ifdef VBOX_WS_MAC connect(uisession(), SIGNAL(sigShowWindows()), this, SLOT(sltShowWindows())); #endif /* VBOX_WS_MAC */ connect(uisession(), SIGNAL(sigGuestMonitorChange(KGuestMonitorChangedEventType, ulong, QRect)), this, SLOT(sltGuestMonitorChange(KGuestMonitorChangedEventType, ulong, QRect))); /* We should watch for host-screen-change events: */ connect(uisession(), SIGNAL(sigHostScreenCountChange()), this, SLOT(sltHostScreenCountChange())); connect(uisession(), SIGNAL(sigHostScreenGeometryChange()), this, SLOT(sltHostScreenGeometryChange())); connect(uisession(), SIGNAL(sigHostScreenAvailableAreaChange()), this, SLOT(sltHostScreenAvailableAreaChange())); /* We should notify about frame-buffer events: */ connect(this, SIGNAL(sigFrameBufferResize()), uisession(), SIGNAL(sigFrameBufferResize())); } void UIMachineLogic::prepareActionGroups() { /* Create group for all actions that are enabled only when the VM is running. * Note that only actions whose enabled state depends exclusively on the * execution state of the VM are added to this group. */ m_pRunningActions = new QActionGroup(this); m_pRunningActions->setExclusive(false); /* Create group for all actions that are enabled when the VM is running or paused. * Note that only actions whose enabled state depends exclusively on the * execution state of the VM are added to this group. */ m_pRunningOrPausedActions = new QActionGroup(this); m_pRunningOrPausedActions->setExclusive(false); /* Create group for all actions that are enabled when the VM is running or paused or stucked. * Note that only actions whose enabled state depends exclusively on the * execution state of the VM are added to this group. */ m_pRunningOrPausedOrStackedActions = new QActionGroup(this); m_pRunningOrPausedOrStackedActions->setExclusive(false); /* Move actions into running actions group: */ m_pRunningActions->addAction(actionPool()->action(UIActionIndexRT_M_Machine_S_Reset)); m_pRunningActions->addAction(actionPool()->action(UIActionIndexRT_M_Machine_S_Shutdown)); m_pRunningActions->addAction(actionPool()->action(UIActionIndexRT_M_View_T_Fullscreen)); m_pRunningActions->addAction(actionPool()->action(UIActionIndexRT_M_View_T_Seamless)); m_pRunningActions->addAction(actionPool()->action(UIActionIndexRT_M_View_T_Scale)); m_pRunningActions->addAction(actionPool()->action(UIActionIndexRT_M_View_T_GuestAutoresize)); m_pRunningActions->addAction(actionPool()->action(UIActionIndexRT_M_Input_M_Keyboard_S_TypeCAD)); #ifdef VBOX_WS_X11 m_pRunningActions->addAction(actionPool()->action(UIActionIndexRT_M_Input_M_Keyboard_S_TypeCABS)); #endif /* VBOX_WS_X11 */ m_pRunningActions->addAction(actionPool()->action(UIActionIndexRT_M_Input_M_Keyboard_S_TypeCtrlBreak)); m_pRunningActions->addAction(actionPool()->action(UIActionIndexRT_M_Input_M_Keyboard_S_TypeInsert)); m_pRunningActions->addAction(actionPool()->action(UIActionIndexRT_M_Input_M_Keyboard_S_TypePrintScreen)); m_pRunningActions->addAction(actionPool()->action(UIActionIndexRT_M_Input_M_Keyboard_S_TypeAltPrintScreen)); /* Move actions into running-n-paused actions group: */ m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_Machine_S_Detach)); m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_Machine_S_SaveState)); m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_Machine_S_Settings)); m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_Machine_S_TakeSnapshot)); m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_Machine_S_ShowInformation)); m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_Machine_T_Pause)); #ifndef VBOX_WS_MAC m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_View_S_MinimizeWindow)); #endif /* !VBOX_WS_MAC */ m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_View_S_AdjustWindow)); m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_View_S_TakeScreenshot)); m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_View_M_VideoCapture)); m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_View_M_VideoCapture_S_Settings)); m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_View_M_VideoCapture_T_Start)); m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_View_T_VRDEServer)); m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_View_M_MenuBar)); m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_View_M_MenuBar_S_Settings)); #ifndef VBOX_WS_MAC m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_View_M_MenuBar_T_Visibility)); #endif /* !VBOX_WS_MAC */ m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_View_M_StatusBar)); m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_View_M_StatusBar_S_Settings)); m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_View_M_StatusBar_T_Visibility)); m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_View_M_ScaleFactor)); m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_Input_M_Keyboard)); m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_Input_M_Keyboard_S_Settings)); m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_Input_M_Mouse)); m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_Input_M_Mouse_T_Integration)); m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_Devices_M_HardDrives)); m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_Devices_M_HardDrives_S_Settings)); m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_Devices_M_OpticalDevices)); m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_Devices_M_FloppyDevices)); m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_Devices_M_Audio)); m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_Devices_M_Audio_T_Output)); m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_Devices_M_Audio_T_Output)); m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_Devices_M_Network)); m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_Devices_M_Network_S_Settings)); m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_Devices_M_USBDevices)); m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_Devices_M_USBDevices_S_Settings)); m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_Devices_M_WebCams)); m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_Devices_M_SharedClipboard)); m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_Devices_M_DragAndDrop)); m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_Devices_M_SharedFolders)); m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_Devices_M_SharedFolders_S_Settings)); m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_Devices_S_InstallGuestTools)); #ifdef VBOX_WS_MAC m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndex_M_Window)); m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndex_M_Window_S_Minimize)); #endif /* VBOX_WS_MAC */ /* Move actions into running-n-paused-n-stucked actions group: */ m_pRunningOrPausedOrStackedActions->addAction(actionPool()->action(UIActionIndexRT_M_Machine_S_PowerOff)); } void UIMachineLogic::prepareActionConnections() { /* 'Application' actions connection: */ connect(actionPool()->action(UIActionIndex_M_Application_S_Preferences), SIGNAL(triggered()), this, SLOT(sltShowGlobalPreferences()), Qt::UniqueConnection); connect(actionPool()->action(UIActionIndex_M_Application_S_Close), SIGNAL(triggered()), this, SLOT(sltClose()), Qt::QueuedConnection); /* 'Machine' actions connections: */ connect(actionPool()->action(UIActionIndexRT_M_Machine_S_Settings), SIGNAL(triggered()), this, SLOT(sltOpenVMSettingsDialog())); connect(actionPool()->action(UIActionIndexRT_M_Machine_S_TakeSnapshot), SIGNAL(triggered()), this, SLOT(sltTakeSnapshot())); connect(actionPool()->action(UIActionIndexRT_M_Machine_S_ShowInformation), SIGNAL(triggered()), this, SLOT(sltShowInformationDialog())); connect(actionPool()->action(UIActionIndexRT_M_Machine_T_Pause), SIGNAL(toggled(bool)), this, SLOT(sltPause(bool))); connect(actionPool()->action(UIActionIndexRT_M_Machine_S_Reset), SIGNAL(triggered()), this, SLOT(sltReset())); connect(actionPool()->action(UIActionIndexRT_M_Machine_S_Detach), SIGNAL(triggered()), this, SLOT(sltDetach()), Qt::QueuedConnection); connect(actionPool()->action(UIActionIndexRT_M_Machine_S_SaveState), SIGNAL(triggered()), this, SLOT(sltSaveState()), Qt::QueuedConnection); connect(actionPool()->action(UIActionIndexRT_M_Machine_S_Shutdown), SIGNAL(triggered()), this, SLOT(sltShutdown())); connect(actionPool()->action(UIActionIndexRT_M_Machine_S_PowerOff), SIGNAL(triggered()), this, SLOT(sltPowerOff()), Qt::QueuedConnection); /* 'View' actions connections: */ #ifndef VBOX_WS_MAC connect(actionPool()->action(UIActionIndexRT_M_View_S_MinimizeWindow), SIGNAL(triggered()), this, SLOT(sltMinimizeActiveMachineWindow()), Qt::QueuedConnection); #endif /* !VBOX_WS_MAC */ connect(actionPool()->action(UIActionIndexRT_M_View_S_AdjustWindow), SIGNAL(triggered()), this, SLOT(sltAdjustMachineWindows())); connect(actionPool()->action(UIActionIndexRT_M_View_T_GuestAutoresize), SIGNAL(toggled(bool)), this, SLOT(sltToggleGuestAutoresize(bool))); connect(actionPool()->action(UIActionIndexRT_M_View_S_TakeScreenshot), SIGNAL(triggered()), this, SLOT(sltTakeScreenshot())); connect(actionPool()->action(UIActionIndexRT_M_View_M_VideoCapture_S_Settings), SIGNAL(triggered()), this, SLOT(sltOpenVideoCaptureOptions())); connect(actionPool()->action(UIActionIndexRT_M_View_M_VideoCapture_T_Start), SIGNAL(toggled(bool)), this, SLOT(sltToggleVideoCapture(bool))); connect(actionPool()->action(UIActionIndexRT_M_View_T_VRDEServer), SIGNAL(toggled(bool)), this, SLOT(sltToggleVRDE(bool))); /* 'Input' actions connections: */ connect(actionPool()->action(UIActionIndexRT_M_Input_M_Keyboard_S_Settings), SIGNAL(triggered()), this, SLOT(sltShowKeyboardSettings())); connect(actionPool()->action(UIActionIndexRT_M_Input_M_Keyboard_S_TypeCAD), SIGNAL(triggered()), this, SLOT(sltTypeCAD())); #ifdef VBOX_WS_X11 connect(actionPool()->action(UIActionIndexRT_M_Input_M_Keyboard_S_TypeCABS), SIGNAL(triggered()), this, SLOT(sltTypeCABS())); #endif /* VBOX_WS_X11 */ connect(actionPool()->action(UIActionIndexRT_M_Input_M_Keyboard_S_TypeCtrlBreak), SIGNAL(triggered()), this, SLOT(sltTypeCtrlBreak())); connect(actionPool()->action(UIActionIndexRT_M_Input_M_Keyboard_S_TypeInsert), SIGNAL(triggered()), this, SLOT(sltTypeInsert())); connect(actionPool()->action(UIActionIndexRT_M_Input_M_Keyboard_S_TypePrintScreen), SIGNAL(triggered()), this, SLOT(sltTypePrintScreen())); connect(actionPool()->action(UIActionIndexRT_M_Input_M_Keyboard_S_TypeAltPrintScreen), SIGNAL(triggered()), this, SLOT(sltTypeAltPrintScreen())); connect(actionPool()->action(UIActionIndexRT_M_Input_M_Mouse_T_Integration), SIGNAL(toggled(bool)), this, SLOT(sltToggleMouseIntegration(bool))); /* 'Devices' actions connections: */ connect(actionPool(), SIGNAL(sigNotifyAboutMenuPrepare(int, QMenu*)), this, SLOT(sltHandleMenuPrepare(int, QMenu*))); connect(actionPool()->action(UIActionIndexRT_M_Devices_M_HardDrives_S_Settings), SIGNAL(triggered()), this, SLOT(sltOpenStorageSettingsDialog())); connect(actionPool()->action(UIActionIndexRT_M_Devices_M_Audio_T_Output), &UIAction::toggled, this, &UIMachineLogic::sltToggleAudioOutput); connect(actionPool()->action(UIActionIndexRT_M_Devices_M_Audio_T_Input), &UIAction::toggled, this, &UIMachineLogic::sltToggleAudioInput); connect(actionPool()->action(UIActionIndexRT_M_Devices_M_Network_S_Settings), SIGNAL(triggered()), this, SLOT(sltOpenNetworkSettingsDialog())); connect(actionPool()->action(UIActionIndexRT_M_Devices_M_USBDevices_S_Settings), SIGNAL(triggered()), this, SLOT(sltOpenUSBDevicesSettingsDialog())); connect(actionPool()->action(UIActionIndexRT_M_Devices_M_SharedFolders_S_Settings), SIGNAL(triggered()), this, SLOT(sltOpenSharedFoldersSettingsDialog())); connect(actionPool()->action(UIActionIndexRT_M_Devices_S_InstallGuestTools), SIGNAL(triggered()), this, SLOT(sltInstallGuestAdditions())); #ifdef VBOX_WITH_DEBUGGER_GUI /* 'Debug' actions connections: */ connect(actionPool()->action(UIActionIndexRT_M_Debug_S_ShowStatistics), SIGNAL(triggered()), this, SLOT(sltShowDebugStatistics())); connect(actionPool()->action(UIActionIndexRT_M_Debug_S_ShowCommandLine), SIGNAL(triggered()), this, SLOT(sltShowDebugCommandLine())); connect(actionPool()->action(UIActionIndexRT_M_Debug_T_Logging), SIGNAL(toggled(bool)), this, SLOT(sltLoggingToggled(bool))); connect(actionPool()->action(UIActionIndexRT_M_Debug_S_ShowLogDialog), SIGNAL(triggered()), this, SLOT(sltShowLogDialog())); #endif /* VBOX_WITH_DEBUGGER_GUI */ #ifdef VBOX_WS_MAC /* 'Window' action connections: */ connect(actionPool()->action(UIActionIndex_M_Window_S_Minimize), SIGNAL(triggered()), this, SLOT(sltMinimizeActiveMachineWindow()), Qt::QueuedConnection); #endif /* VBOX_WS_MAC */ } void UIMachineLogic::prepareHandlers() { /* Prepare menu update-handlers: */ m_menuUpdateHandlers[UIActionIndexRT_M_Devices_M_OpticalDevices] = &UIMachineLogic::updateMenuDevicesStorage; m_menuUpdateHandlers[UIActionIndexRT_M_Devices_M_FloppyDevices] = &UIMachineLogic::updateMenuDevicesStorage; m_menuUpdateHandlers[UIActionIndexRT_M_Devices_M_Network] = &UIMachineLogic::updateMenuDevicesNetwork; m_menuUpdateHandlers[UIActionIndexRT_M_Devices_M_USBDevices] = &UIMachineLogic::updateMenuDevicesUSB; m_menuUpdateHandlers[UIActionIndexRT_M_Devices_M_WebCams] = &UIMachineLogic::updateMenuDevicesWebCams; m_menuUpdateHandlers[UIActionIndexRT_M_Devices_M_SharedClipboard] = &UIMachineLogic::updateMenuDevicesSharedClipboard; m_menuUpdateHandlers[UIActionIndexRT_M_Devices_M_DragAndDrop] = &UIMachineLogic::updateMenuDevicesDragAndDrop; #ifdef VBOX_WITH_DEBUGGER_GUI m_menuUpdateHandlers[UIActionIndexRT_M_Debug] = &UIMachineLogic::updateMenuDebug; #endif /* VBOX_WITH_DEBUGGER_GUI */ #ifdef VBOX_WS_MAC m_menuUpdateHandlers[UIActionIndex_M_Window] = &UIMachineLogic::updateMenuWindow; #endif /* VBOX_WS_MAC */ /* Create keyboard/mouse handlers: */ setKeyboardHandler(UIKeyboardHandler::create(this, visualStateType())); setMouseHandler(UIMouseHandler::create(this, visualStateType())); /* Update UI session values with current: */ uisession()->setKeyboardState(keyboardHandler()->state()); uisession()->setMouseState(mouseHandler()->state()); } #ifdef VBOX_WS_MAC void UIMachineLogic::prepareDock() { QMenu *pDockMenu = actionPool()->action(UIActionIndexRT_M_Dock)->menu(); /* Clear the menu to get rid of any previously added actions and separators: */ pDockMenu->clear(); /* Add all the 'Machine' menu entries to the 'Dock' menu: */ QList<QAction*> actions = actionPool()->action(UIActionIndexRT_M_Machine)->menu()->actions(); m_dockMachineMenuActions.clear(); for (int i=0; i < actions.size(); ++i) { /* Check if we really have correct action: */ UIAction *pAction = qobject_cast<UIAction*>(actions.at(i)); /* Skip incorrect actions: */ if (!pAction) continue; /* Skip actions which have 'role' (to prevent consuming): */ if (pAction->menuRole() != QAction::NoRole) continue; /* Skip actions which have menu (to prevent consuming): */ if (qobject_cast<UIActionMenu*>(pAction)) continue; if (!pAction->isAllowed()) continue; pDockMenu->addAction(actions.at(i)); m_dockMachineMenuActions.push_back(actions.at(i)); } if (!m_dockMachineMenuActions.empty()) { m_dockMachineMenuActions.push_back(pDockMenu->addSeparator()); } QMenu *pDockSettingsMenu = actionPool()->action(UIActionIndexRT_M_Dock_M_DockSettings)->menu(); /* Clear the menu to get rid of any previously added actions and separators: */ pDockSettingsMenu->clear(); QActionGroup *pDockPreviewModeGroup = new QActionGroup(this); QAction *pDockDisablePreview = actionPool()->action(UIActionIndexRT_M_Dock_M_DockSettings_T_DisableMonitor); pDockPreviewModeGroup->addAction(pDockDisablePreview); QAction *pDockEnablePreviewMonitor = actionPool()->action(UIActionIndexRT_M_Dock_M_DockSettings_T_PreviewMonitor); pDockPreviewModeGroup->addAction(pDockEnablePreviewMonitor); pDockSettingsMenu->addActions(pDockPreviewModeGroup->actions()); connect(pDockPreviewModeGroup, SIGNAL(triggered(QAction*)), this, SLOT(sltDockPreviewModeChanged(QAction*))); connect(gEDataManager, SIGNAL(sigDockIconAppearanceChange(bool)), this, SLOT(sltChangeDockIconUpdate(bool))); /* Get dock icon disable overlay action: */ QAction *pDockIconDisableOverlay = actionPool()->action(UIActionIndexRT_M_Dock_M_DockSettings_T_DisableOverlay); /* Prepare dock icon disable overlay action with initial data: */ pDockIconDisableOverlay->setChecked(gEDataManager->dockIconDisableOverlay(vboxGlobal().managedVMUuid())); /* Connect dock icon disable overlay related signals: */ connect(pDockIconDisableOverlay, SIGNAL(triggered(bool)), this, SLOT(sltDockIconDisableOverlayChanged(bool))); connect(gEDataManager, SIGNAL(sigDockIconOverlayAppearanceChange(bool)), this, SLOT(sltChangeDockIconOverlayAppearance(bool))); /* Add dock icon disable overlay action to the dock settings menu: */ pDockSettingsMenu->addAction(pDockIconDisableOverlay); /* If we have more than one visible window: */ const QList<int> visibleWindowsList = uisession()->listOfVisibleWindows(); const int cVisibleGuestScreens = visibleWindowsList.size(); if (cVisibleGuestScreens > 1) { /* Add separator: */ m_pDockSettingsMenuSeparator = pDockSettingsMenu->addSeparator(); int extraDataUpdateMonitor = gEDataManager->realtimeDockIconUpdateMonitor(vboxGlobal().managedVMUuid()); if (visibleWindowsList.contains(extraDataUpdateMonitor)) m_DockIconPreviewMonitor = extraDataUpdateMonitor; else m_DockIconPreviewMonitor = visibleWindowsList.at(cVisibleGuestScreens - 1); m_pDockPreviewSelectMonitorGroup = new QActionGroup(this); /* And dock preview actions: */ for (int i = 0; i < cVisibleGuestScreens; ++i) { QAction *pAction = new QAction(m_pDockPreviewSelectMonitorGroup); pAction->setCheckable(true); pAction->setData(visibleWindowsList.at(i)); if (m_DockIconPreviewMonitor == visibleWindowsList.at(i)) pAction->setChecked(true); } pDockSettingsMenu->addActions(m_pDockPreviewSelectMonitorGroup->actions()); connect(m_pDockPreviewSelectMonitorGroup, SIGNAL(triggered(QAction*)), this, SLOT(sltDockPreviewMonitorChanged(QAction*))); } m_pDockSettingMenuAction = pDockMenu->addMenu(pDockSettingsMenu); /* Add it to the dock: */ pDockMenu->setAsDockMenu(); /* Now the dock icon preview: */ QPixmap pixmap = vboxGlobal().vmUserPixmap(machine(), QSize(42, 42)); if (pixmap.isNull()) pixmap = vboxGlobal().vmGuestOSTypePixmap(guest().GetOSTypeId(), QSize(42, 42)); m_pDockIconPreview = new UIDockIconPreview(uisession(), pixmap); /* Should the dock-icon be updated at runtime? */ bool fEnabled = gEDataManager->realtimeDockIconUpdateEnabled(vboxGlobal().managedVMUuid()); if (fEnabled) pDockEnablePreviewMonitor->setChecked(true); else { pDockDisablePreview->setChecked(true); if(m_pDockPreviewSelectMonitorGroup) m_pDockPreviewSelectMonitorGroup->setEnabled(false); } setDockIconPreviewEnabled(fEnabled); updateDockOverlay(); } void UIMachineLogic::updateDock() { QMenu *pDockSettingsMenu = actionPool()->action(UIActionIndexRT_M_Dock_M_DockSettings)->menu(); AssertReturnVoid(pDockSettingsMenu); QMenu *pDockMenu = actionPool()->action(UIActionIndexRT_M_Dock)->menu(); AssertReturnVoid(pDockMenu); /* Clean previous machine menu actions: */ for (int i=0; i < m_dockMachineMenuActions.size(); ++i) { pDockMenu->removeAction(m_dockMachineMenuActions.at(i)); if (m_dockMachineMenuActions.at(i)->isSeparator()) delete m_dockMachineMenuActions[i]; } m_dockMachineMenuActions.clear(); /* Determine the list of actions to be inserted: */ QList<QAction*> actions = actionPool()->action(UIActionIndexRT_M_Machine)->menu()->actions(); QList<QAction*> allowedActions; for (int i=0; i < actions.size(); ++i) { /* Check if we really have correct action: */ UIAction *pAction = qobject_cast<UIAction*>(actions.at(i)); /* Skip incorrect actions: */ if (!pAction) continue; /* Skip actions which have 'role' (to prevent consuming): */ if (pAction->menuRole() != QAction::NoRole) continue; /* Skip actions which have menu (to prevent consuming): */ if (qobject_cast<UIActionMenu*>(pAction)) continue; if (!pAction->isAllowed()) continue; allowedActions.push_back(actions.at(i)); } if (!allowedActions.empty()) { QAction *pSeparator = new QAction(pDockMenu); pSeparator->setSeparator(true); allowedActions.push_back(pSeparator); pDockMenu->insertActions(m_pDockSettingMenuAction, allowedActions); m_dockMachineMenuActions = allowedActions; } /* Clean the previous preview actions: */ if (m_pDockPreviewSelectMonitorGroup) { QList<QAction*> previewActions = m_pDockPreviewSelectMonitorGroup->actions(); foreach (QAction *pAction, previewActions) { pDockSettingsMenu->removeAction(pAction); m_pDockPreviewSelectMonitorGroup->removeAction(pAction); delete pAction; } } const QList<int> visibleWindowsList = uisession()->listOfVisibleWindows(); const int cVisibleGuestScreens = visibleWindowsList.size(); if (cVisibleGuestScreens > 1) { if (!m_pDockPreviewSelectMonitorGroup) m_pDockPreviewSelectMonitorGroup = new QActionGroup(this); /* Only if currently selected monitor for icon preview is not enabled: */ if (!visibleWindowsList.contains(m_DockIconPreviewMonitor)) { int iExtraDataUpdateMonitor = gEDataManager->realtimeDockIconUpdateMonitor(vboxGlobal().managedVMUuid()); if (visibleWindowsList.contains(iExtraDataUpdateMonitor)) m_DockIconPreviewMonitor = iExtraDataUpdateMonitor; else m_DockIconPreviewMonitor = visibleWindowsList.at(cVisibleGuestScreens - 1); } if (!m_pDockSettingsMenuSeparator) m_pDockSettingsMenuSeparator = pDockSettingsMenu->addSeparator(); for (int i=0; i < cVisibleGuestScreens; ++i) { QAction *pAction = new QAction(m_pDockPreviewSelectMonitorGroup); pAction->setCheckable(true); pAction->setData(visibleWindowsList.at(i)); pAction->setText(QApplication::translate("UIActionPool", "Preview Monitor %1").arg(pAction->data().toInt() + 1)); if (m_DockIconPreviewMonitor == visibleWindowsList.at(i)) pAction->setChecked(true); } pDockSettingsMenu->addActions(m_pDockPreviewSelectMonitorGroup->actions()); connect(m_pDockPreviewSelectMonitorGroup, SIGNAL(triggered(QAction*)), this, SLOT(sltDockPreviewMonitorChanged(QAction*))); } else { m_DockIconPreviewMonitor = 0; /* Remove the seperator as well: */ if (m_pDockSettingsMenuSeparator) { pDockSettingsMenu->removeAction(m_pDockSettingsMenuSeparator); delete m_pDockSettingsMenuSeparator; m_pDockSettingsMenuSeparator = 0; } } } #endif /* VBOX_WS_MAC */ #ifdef VBOX_WITH_DEBUGGER_GUI void UIMachineLogic::prepareDebugger() { if (vboxGlobal().isDebuggerAutoShowEnabled()) { if (vboxGlobal().isDebuggerAutoShowStatisticsEnabled()) sltShowDebugStatistics(); if (vboxGlobal().isDebuggerAutoShowCommandLineEnabled()) sltShowDebugCommandLine(); } } #endif /* VBOX_WITH_DEBUGGER_GUI */ void UIMachineLogic::loadSettings() { #if defined(VBOX_WS_MAC) || defined(VBOX_WS_WIN) /* Read cached extra-data value: */ m_fIsHidLedsSyncEnabled = gEDataManager->hidLedsSyncState(vboxGlobal().managedVMUuid()); /* Subscribe to extra-data changes to be able to enable/disable feature dynamically: */ connect(gEDataManager, SIGNAL(sigHidLedsSyncStateChange(bool)), this, SLOT(sltHidLedsSyncStateChanged(bool))); #endif /* VBOX_WS_MAC || VBOX_WS_WIN */ /* HID LEDs sync initialization: */ sltSwitchKeyboardLedsToGuestLeds(); } void UIMachineLogic::saveSettings() { /* HID LEDs sync deinitialization: */ sltSwitchKeyboardLedsToPreviousLeds(); } #ifdef VBOX_WITH_DEBUGGER_GUI void UIMachineLogic::cleanupDebugger() { /* Close debugger: */ dbgDestroy(); } #endif /* VBOX_WITH_DEBUGGER_GUI */ #ifdef VBOX_WS_MAC void UIMachineLogic::cleanupDock() { if (m_pDockIconPreview) { delete m_pDockIconPreview; m_pDockIconPreview = 0; } } #endif /* VBOX_WS_MAC */ void UIMachineLogic::cleanupHandlers() { /* Cleanup mouse-handler: */ UIMouseHandler::destroy(mouseHandler()); /* Cleanup keyboard-handler: */ UIKeyboardHandler::destroy(keyboardHandler()); } void UIMachineLogic::cleanupSessionConnections() { /* We should stop watching for VBoxSVC availability changes: */ disconnect(&vboxGlobal(), SIGNAL(sigVBoxSVCAvailabilityChange()), this, SLOT(sltHandleVBoxSVCAvailabilityChange())); /* We should stop watching for requested modes: */ disconnect(uisession(), SIGNAL(sigInitialized()), this, SLOT(sltCheckForRequestedVisualStateType())); disconnect(uisession(), SIGNAL(sigAdditionsStateChange()), this, SLOT(sltCheckForRequestedVisualStateType())); /* We should stop watching for console events: */ disconnect(uisession(), SIGNAL(sigMachineStateChange()), this, SLOT(sltMachineStateChanged())); disconnect(uisession(), SIGNAL(sigAdditionsStateActualChange()), this, SLOT(sltAdditionsStateChanged())); disconnect(uisession(), SIGNAL(sigMouseCapabilityChange()), this, SLOT(sltMouseCapabilityChanged())); disconnect(uisession(), SIGNAL(sigKeyboardLedsChange()), this, SLOT(sltKeyboardLedsChanged())); disconnect(uisession(), SIGNAL(sigUSBDeviceStateChange(const CUSBDevice &, bool, const CVirtualBoxErrorInfo &)), this, SLOT(sltUSBDeviceStateChange(const CUSBDevice &, bool, const CVirtualBoxErrorInfo &))); disconnect(uisession(), SIGNAL(sigRuntimeError(bool, const QString &, const QString &)), this, SLOT(sltRuntimeError(bool, const QString &, const QString &))); #ifdef VBOX_WS_MAC disconnect(uisession(), SIGNAL(sigShowWindows()), this, SLOT(sltShowWindows())); #endif /* VBOX_WS_MAC */ disconnect(uisession(), SIGNAL(sigGuestMonitorChange(KGuestMonitorChangedEventType, ulong, QRect)), this, SLOT(sltGuestMonitorChange(KGuestMonitorChangedEventType, ulong, QRect))); /* We should stop watching for host-screen-change events: */ disconnect(uisession(), SIGNAL(sigHostScreenCountChange()), this, SLOT(sltHostScreenCountChange())); disconnect(uisession(), SIGNAL(sigHostScreenGeometryChange()), this, SLOT(sltHostScreenGeometryChange())); disconnect(uisession(), SIGNAL(sigHostScreenAvailableAreaChange()), this, SLOT(sltHostScreenAvailableAreaChange())); /* We should stop notify about frame-buffer events: */ disconnect(this, SIGNAL(sigFrameBufferResize()), uisession(), SIGNAL(sigFrameBufferResize())); } bool UIMachineLogic::eventFilter(QObject *pWatched, QEvent *pEvent) { /* Handle machine-window events: */ if (UIMachineWindow *pMachineWindow = qobject_cast<UIMachineWindow*>(pWatched)) { /* Make sure this window still registered: */ if (isMachineWindowsCreated() && m_machineWindowsList.contains(pMachineWindow)) { switch (pEvent->type()) { /* Handle *window activated* event: */ case QEvent::WindowActivate: { #ifdef VBOX_WS_WIN /* We should save current lock states as *previous* and * set current lock states to guest values we have, * As we have no ipc between threads of different VMs * we are using 100ms timer as lazy sync timout: */ /* On Windows host we should do that only in case if sync * is enabled. Otherwise, keyboardHandler()->winSkipKeyboardEvents(false) * won't be called in sltSwitchKeyboardLedsToGuestLeds() and guest * will loose keyboard input forever. */ if (isHidLedsSyncEnabled()) { keyboardHandler()->winSkipKeyboardEvents(true); QTimer::singleShot(100, this, SLOT(sltSwitchKeyboardLedsToGuestLeds())); } #else /* VBOX_WS_WIN */ /* Trigger callback synchronously for now! */ sltSwitchKeyboardLedsToGuestLeds(); #endif /* !VBOX_WS_WIN */ break; } /* Handle *window deactivated* event: */ case QEvent::WindowDeactivate: { /* We should restore lock states to *previous* known: */ sltSwitchKeyboardLedsToPreviousLeds(); break; } /* Default: */ default: break; } } } /* Call to base-class: */ return QIWithRetranslateUI3<QObject>::eventFilter(pWatched, pEvent); } void UIMachineLogic::sltHandleMenuPrepare(int iIndex, QMenu *pMenu) { /* Update if there is update-handler: */ if (m_menuUpdateHandlers.contains(iIndex)) (this->*(m_menuUpdateHandlers.value(iIndex)))(pMenu); } void UIMachineLogic::sltShowKeyboardSettings() { /* Do not process if window(s) missed! */ if (!isMachineWindowsCreated()) return; /* Open Global Preferences: Input page: */ showGlobalPreferences("#input", "m_pMachineTable"); } void UIMachineLogic::sltToggleMouseIntegration(bool fEnabled) { /* Do not process if window(s) missed! */ if (!isMachineWindowsCreated()) return; /* Disable/Enable mouse-integration for all view(s): */ mouseHandler()->setMouseIntegrationEnabled(fEnabled); } void UIMachineLogic::sltTypeCAD() { keyboard().PutCAD(); AssertWrapperOk(keyboard()); } #ifdef VBOX_WS_X11 void UIMachineLogic::sltTypeCABS() { static QVector<LONG> sequence(6); sequence[0] = 0x1d; /* Ctrl down */ sequence[1] = 0x38; /* Alt down */ sequence[2] = 0x0E; /* Backspace down */ sequence[3] = 0x0E | 0x80; /* Backspace up */ sequence[4] = 0x38 | 0x80; /* Alt up */ sequence[5] = 0x1d | 0x80; /* Ctrl up */ keyboard().PutScancodes(sequence); AssertWrapperOk(keyboard()); } #endif /* VBOX_WS_X11 */ void UIMachineLogic::sltTypeCtrlBreak() { static QVector<LONG> sequence(6); sequence[0] = 0x1d; /* Ctrl down */ sequence[1] = 0xe0; /* Extended flag */ sequence[2] = 0x46; /* Break down */ sequence[3] = 0xe0; /* Extended flag */ sequence[4] = 0x46 | 0x80; /* Break up */ sequence[5] = 0x1d | 0x80; /* Ctrl up */ keyboard().PutScancodes(sequence); AssertWrapperOk(keyboard()); } void UIMachineLogic::sltTypeInsert() { static QVector<LONG> sequence(4); sequence[0] = 0xE0; /* Extended flag */ sequence[1] = 0x52; /* Insert down */ sequence[2] = 0xE0; /* Extended flag */ sequence[3] = 0x52 | 0x80; /* Insert up */ keyboard().PutScancodes(sequence); AssertWrapperOk(keyboard()); } void UIMachineLogic::sltTypePrintScreen() { static QVector<LONG> sequence(8); sequence[0] = 0xE0; /* Extended flag */ sequence[1] = 0x2A; /* Print.. down */ sequence[2] = 0xE0; /* Extended flag */ sequence[3] = 0x37; /* ..Screen down */ sequence[4] = 0xE0; /* Extended flag */ sequence[5] = 0x37 | 0x80; /* ..Screen up */ sequence[6] = 0xE0; /* Extended flag */ sequence[7] = 0x2A | 0x80; /* Print.. up */ keyboard().PutScancodes(sequence); AssertWrapperOk(keyboard()); } void UIMachineLogic::sltTypeAltPrintScreen() { static QVector<LONG> sequence(10); sequence[0] = 0x38; /* Alt down */ sequence[1] = 0xE0; /* Extended flag */ sequence[2] = 0x2A; /* Print.. down */ sequence[3] = 0xE0; /* Extended flag */ sequence[4] = 0x37; /* ..Screen down */ sequence[5] = 0xE0; /* Extended flag */ sequence[6] = 0x37 | 0x80; /* ..Screen up */ sequence[7] = 0xE0; /* Extended flag */ sequence[8] = 0x2A | 0x80; /* Print.. up */ sequence[9] = 0x38 | 0x80; /* Alt up */ keyboard().PutScancodes(sequence); AssertWrapperOk(keyboard()); } void UIMachineLogic::sltTakeSnapshot() { /* Do not process if window(s) missed! */ if (!isMachineWindowsCreated()) return; /* Create take-snapshot dialog: */ QWidget *pDlgParent = windowManager().realParentWindow(activeMachineWindow()); QPointer<UITakeSnapshotDialog> pDlg = new UITakeSnapshotDialog(pDlgParent, machine()); windowManager().registerNewParent(pDlg, pDlgParent); /* Assign corresponding icon: */ if (uisession() && uisession()->machineWindowIcon()) { const int iIconMetric = QApplication::style()->pixelMetric(QStyle::PM_LargeIconSize); pDlg->setPixmap(uisession()->machineWindowIcon()->pixmap(QSize(iIconMetric, iIconMetric))); } /* Search for the max available filter index: */ QString strNameTemplate = UITakeSnapshotDialog::tr("Snapshot %1"); int iMaxSnapshotIndex = searchMaxSnapshotIndex(machine(), machine().FindSnapshot(QString()), strNameTemplate); pDlg->setName(strNameTemplate.arg(++ iMaxSnapshotIndex)); /* Exec the dialog: */ bool fDialogAccepted = pDlg->exec() == QDialog::Accepted; /* Make sure dialog still valid: */ if (!pDlg) return; /* Acquire variables: */ QString strSnapshotName = pDlg->name().trimmed(); QString strSnapshotDescription = pDlg->description(); /* Destroy dialog early: */ delete pDlg; /* Was the dialog accepted? */ if (fDialogAccepted) { QString strSnapshotId; /* Prepare the take-snapshot progress: */ CProgress progress = machine().TakeSnapshot(strSnapshotName, strSnapshotDescription, true, strSnapshotId); if (machine().isOk()) { /* Show the take-snapshot progress: */ const bool fStillValid = msgCenter().showModalProgressDialog(progress, machineName(), ":/progress_snapshot_create_90px.png"); if (!fStillValid) return; if (!progress.isOk() || progress.GetResultCode() != 0) msgCenter().cannotTakeSnapshot(progress, machineName()); } else msgCenter().cannotTakeSnapshot(machine(), machineName()); } } void UIMachineLogic::sltShowInformationDialog() { /* Do not process if window(s) missed! */ if (!isMachineWindowsCreated()) return; /* Invoke VM information dialog: */ UIVMInformationDialog::invoke(activeMachineWindow()); } void UIMachineLogic::sltReset() { /* Confirm/Reset current console: */ if (msgCenter().confirmResetMachine(machineName())) console().Reset(); /* TODO_NEW_CORE: On reset the additional screens didn't get a display update. Emulate this for now until it get fixed. */ ulong uMonitorCount = machine().GetMonitorCount(); for (ulong uScreenId = 1; uScreenId < uMonitorCount; ++uScreenId) machineWindows().at(uScreenId)->update(); } void UIMachineLogic::sltPause(bool fOn) { uisession()->setPause(fOn); } void UIMachineLogic::sltDetach() { /* Make sure machine is in one of the allowed states: */ if (!uisession()->isRunning() && !uisession()->isPaused()) { AssertMsgFailed(("Invalid machine-state. Action should be prohibited!")); return; } detach(); } void UIMachineLogic::sltSaveState() { /* Make sure machine is in one of the allowed states: */ if (!uisession()->isRunning() && !uisession()->isPaused()) { AssertMsgFailed(("Invalid machine-state. Action should be prohibited!")); return; } saveState(); } void UIMachineLogic::sltShutdown() { /* Make sure machine is in one of the allowed states: */ if (!uisession()->isRunning()) { AssertMsgFailed(("Invalid machine-state. Action should be prohibited!")); return; } shutdown(); } void UIMachineLogic::sltPowerOff() { /* Make sure machine is in one of the allowed states: */ if (!uisession()->isRunning() && !uisession()->isPaused() && !uisession()->isStuck()) { AssertMsgFailed(("Invalid machine-state. Action should be prohibited!")); return; } LogRel(("GUI: User request to power VM off.\n")); MachineCloseAction enmLastCloseAction = gEDataManager->lastMachineCloseAction(vboxGlobal().managedVMUuid()); powerOff(machine().GetSnapshotCount() > 0 && enmLastCloseAction == MachineCloseAction_PowerOff_RestoringSnapshot); } void UIMachineLogic::sltClose() { /* Do not process if window(s) missed! */ if (!isMachineWindowsCreated()) return; /* Do not close machine-window in 'manual-override' mode: */ if (isManualOverrideMode()) return; /* First, we have to close/hide any opened modal & popup application widgets. * We have to make sure such window is hidden even if close-event was rejected. * We are re-throwing this slot if any widget present to test again. * If all opened widgets are closed/hidden, we can try to close machine-window: */ QWidget *pWidget = QApplication::activeModalWidget() ? QApplication::activeModalWidget() : QApplication::activePopupWidget() ? QApplication::activePopupWidget() : 0; if (pWidget) { /* Closing/hiding all we found: */ pWidget->close(); if (!pWidget->isHidden()) pWidget->hide(); QTimer::singleShot(0, this, SLOT(sltClose())); return; } /* Try to close active machine-window: */ LogRel(("GUI: Request to close active machine-window.\n")); activeMachineWindow()->close(); } void UIMachineLogic::sltMinimizeActiveMachineWindow() { /* Do not process if window(s) missed! */ if (!isMachineWindowsCreated()) return; /* Minimize active machine-window: */ AssertPtrReturnVoid(activeMachineWindow()); activeMachineWindow()->showMinimized(); } void UIMachineLogic::sltAdjustMachineWindows() { /* Do not process if window(s) missed! */ if (!isMachineWindowsCreated()) return; /* Adjust all window(s)! */ foreach(UIMachineWindow *pMachineWindow, machineWindows()) { /* Exit maximized window state if actual: */ if (pMachineWindow->isMaximized()) pMachineWindow->showNormal(); /* Normalize window geometry: */ pMachineWindow->normalizeGeometry(true /* adjust position */); } } void UIMachineLogic::sltToggleGuestAutoresize(bool fEnabled) { /* Do not process if window(s) missed! */ if (!isMachineWindowsCreated()) return; /* Toggle guest-autoresize feature for all view(s)! */ foreach(UIMachineWindow *pMachineWindow, machineWindows()) pMachineWindow->machineView()->setGuestAutoresizeEnabled(fEnabled); } void UIMachineLogic::sltTakeScreenshot() { /* Do not process if window(s) missed! */ if (!isMachineWindowsCreated()) return; /* Formatting default filename for screenshot. VM folder is the default directory to save: */ const QFileInfo fi(machine().GetSettingsFilePath()); const QString strCurrentTime = QDateTime::currentDateTime().toString("dd_MM_yyyy_hh_mm_ss"); const QString strFormatDefaultFileName = QString("VirtualBox").append("_").append(machine().GetName()).append("_").append(strCurrentTime); const QString strDefaultFileName = QDir(fi.absolutePath()).absoluteFilePath(strFormatDefaultFileName); /* Formatting temporary filename for screenshot. It is saved in system temporary directory if available, else in VM folder: */ QString strTempFile = QDir(fi.absolutePath()).absoluteFilePath("temp").append("_").append(strCurrentTime).append(".png"); if (QDir::temp().exists()) strTempFile = QDir::temp().absoluteFilePath("temp").append("_").append(strCurrentTime).append(".png"); /* Do the screenshot: */ takeScreenshot(strTempFile, "png"); /* Which image formats for writing does this Qt version know of? */ QList<QByteArray> formats = QImageWriter::supportedImageFormats(); QStringList filters; /* Build a filters list out of it: */ for (int i = 0; i < formats.size(); ++i) { const QString &s = formats.at(i) + " (*." + formats.at(i).toLower() + ")"; /* Check there isn't an entry already (even if it just uses another capitalization) */ if (filters.indexOf(QRegExp(QRegExp::escape(s), Qt::CaseInsensitive)) == -1) filters << s; } /* Try to select some common defaults: */ QString strFilter; int i = filters.indexOf(QRegExp(".*png.*", Qt::CaseInsensitive)); if (i == -1) { i = filters.indexOf(QRegExp(".*jpe+g.*", Qt::CaseInsensitive)); if (i == -1) i = filters.indexOf(QRegExp(".*bmp.*", Qt::CaseInsensitive)); } if (i != -1) { filters.prepend(filters.takeAt(i)); strFilter = filters.first(); } #ifdef VBOX_WS_WIN /* Due to Qt bug, modal QFileDialog appeared above the active machine-window * does not retreive the focus from the currently focused machine-view, * as the result guest keyboard remains captured, so we should * clear the focus from this machine-view initially: */ if (activeMachineWindow()) activeMachineWindow()->machineView()->clearFocus(); #endif /* VBOX_WS_WIN */ /* Request the filename from the user: */ const QString strFilename = QIFileDialog::getSaveFileName(strDefaultFileName, filters.join(";;"), activeMachineWindow(), tr("Select a filename for the screenshot ..."), &strFilter, true /* resolve symlinks */, true /* confirm overwrite */); #ifdef VBOX_WS_WIN /* Due to Qt bug, modal QFileDialog appeared above the active machine-window * does not retreive the focus from the currently focused machine-view, * as the result guest keyboard remains captured, so we already * cleared the focus from this machine-view and should return * that focus finally: */ if (activeMachineWindow()) activeMachineWindow()->machineView()->setFocus(); #endif /* VBOX_WS_WIN */ if (!strFilename.isEmpty()) { const QString strFormat = strFilter.split(" ").value(0, "png"); const QImage tmpImage(strTempFile); /* On X11 Qt Filedialog returns the filepath without the filetype suffix, so adding it ourselves: */ #ifdef VBOX_WS_X11 /* Add filetype suffix only if user has not added it explicitly: */ if (!strFilename.endsWith(QString(".%1").arg(strFormat))) tmpImage.save(QDir::toNativeSeparators(QFile::encodeName(QString("%1.%2").arg(strFilename, strFormat))), strFormat.toUtf8().constData()); else tmpImage.save(QDir::toNativeSeparators(QFile::encodeName(strFilename)), strFormat.toUtf8().constData()); #else /* !VBOX_WS_X11 */ tmpImage.save(QDir::toNativeSeparators(QFile::encodeName(strFilename)), strFormat.toUtf8().constData()); #endif /* !VBOX_WS_X11 */ } QFile::remove(strTempFile); } void UIMachineLogic::sltOpenVideoCaptureOptions() { /* Open VM settings : Display page : Video Capture tab: */ sltOpenVMSettingsDialog("#display", "m_pCheckboxVideoCapture"); } void UIMachineLogic::sltToggleVideoCapture(bool fEnabled) { /* Do not process if window(s) missed! */ if (!isMachineWindowsCreated()) return; /* Make sure something had changed: */ if (machine().GetVideoCaptureEnabled() == static_cast<BOOL>(fEnabled)) return; /* Update Video Capture state: */ machine().SetVideoCaptureEnabled(fEnabled); if (!machine().isOk()) { /* Make sure action is updated: */ uisession()->updateStatusVideoCapture(); /* Notify about the error: */ return popupCenter().cannotToggleVideoCapture(activeMachineWindow(), machine(), fEnabled); } /* Save machine-settings: */ machine().SaveSettings(); if (!machine().isOk()) { /* Make sure action is updated: */ uisession()->updateStatusVideoCapture(); /* Notify about the error: */ return msgCenter().cannotSaveMachineSettings(machine()); } } void UIMachineLogic::sltToggleVRDE(bool fEnabled) { /* Do not process if window(s) missed! */ if (!isMachineWindowsCreated()) return; /* Access VRDE server: */ CVRDEServer server = machine().GetVRDEServer(); AssertMsgReturnVoid(machine().isOk() && !server.isNull(), ("VRDE server should NOT be null!\n")); /* Make sure something had changed: */ if (server.GetEnabled() == static_cast<BOOL>(fEnabled)) return; /* Update VRDE server state: */ server.SetEnabled(fEnabled); if (!server.isOk()) { /* Make sure action is updated: */ uisession()->updateStatusVRDE(); /* Notify about the error: */ return popupCenter().cannotToggleVRDEServer(activeMachineWindow(), server, machineName(), fEnabled); } /* Save machine-settings: */ machine().SaveSettings(); if (!machine().isOk()) { /* Make sure action is updated: */ uisession()->updateStatusVRDE(); /* Notify about the error: */ return msgCenter().cannotSaveMachineSettings(machine()); } } void UIMachineLogic::sltOpenVMSettingsDialog(const QString &strCategory /* = QString() */, const QString &strControl /* = QString()*/) { /* Do not process if window(s) missed! */ if (!isMachineWindowsCreated()) return; /* Create VM settings window on the heap! * Its necessary to allow QObject hierarchy cleanup to delete this dialog if necessary: */ QPointer<UISettingsDialogMachine> pDialog = new UISettingsDialogMachine(activeMachineWindow(), machine().GetId(), strCategory, strControl); /* Executing VM settings window. * This blocking function calls for the internal event-loop to process all further events, * including event which can delete the dialog itself. */ pDialog->execute(); /* Delete dialog if its still valid: */ if (pDialog) delete pDialog; /* We can't rely on MediumChange events as they are not yet properly implemented within Main. * We can't watch for MachineData change events as well as they are of broadcast type * and console event-handler do not processing broadcast events. * But we still want to be updated after possible medium changes at least if they were * originated from our side. */ foreach (UIMachineWindow *pMachineWindow, machineWindows()) pMachineWindow->updateAppearanceOf(UIVisualElement_HDStuff | UIVisualElement_CDStuff | UIVisualElement_FDStuff); } void UIMachineLogic::sltOpenStorageSettingsDialog() { /* Machine settings: Storage page: */ sltOpenVMSettingsDialog("#storage"); } void UIMachineLogic::sltToggleAudioOutput(bool fEnabled) { /* Do not process if window(s) missed! */ if (!isMachineWindowsCreated()) return; /* Access audio adapter: */ CAudioAdapter comAdapter = machine().GetAudioAdapter(); AssertMsgReturnVoid(machine().isOk() && comAdapter.isNotNull(), ("Audio adapter should NOT be null!\n")); /* Make sure something had changed: */ if (comAdapter.GetEnabledOut() == static_cast<BOOL>(fEnabled)) return; /* Update audio output state: */ comAdapter.SetEnabledOut(fEnabled); if (!comAdapter.isOk()) { /* Make sure action is updated: */ uisession()->updateAudioOutput(); /* Notify about the error: */ return popupCenter().cannotToggleAudioOutput(activeMachineWindow(), comAdapter, machineName(), fEnabled); } /* Save machine-settings: */ machine().SaveSettings(); if (!machine().isOk()) { /* Make sure action is updated: */ uisession()->updateAudioOutput(); /* Notify about the error: */ return msgCenter().cannotSaveMachineSettings(machine()); } } void UIMachineLogic::sltToggleAudioInput(bool fEnabled) { /* Do not process if window(s) missed! */ if (!isMachineWindowsCreated()) return; /* Access audio adapter: */ CAudioAdapter comAdapter = machine().GetAudioAdapter(); AssertMsgReturnVoid(machine().isOk() && comAdapter.isNotNull(), ("Audio adapter should NOT be null!\n")); /* Make sure something had changed: */ if (comAdapter.GetEnabledIn() == static_cast<BOOL>(fEnabled)) return; /* Update audio input state: */ comAdapter.SetEnabledIn(fEnabled); if (!comAdapter.isOk()) { /* Make sure action is updated: */ uisession()->updateAudioInput(); /* Notify about the error: */ return popupCenter().cannotToggleAudioInput(activeMachineWindow(), comAdapter, machineName(), fEnabled); } /* Save machine-settings: */ machine().SaveSettings(); if (!machine().isOk()) { /* Make sure action is updated: */ uisession()->updateAudioInput(); /* Notify about the error: */ return msgCenter().cannotSaveMachineSettings(machine()); } } void UIMachineLogic::sltOpenNetworkSettingsDialog() { /* Open VM settings : Network page: */ sltOpenVMSettingsDialog("#network"); } void UIMachineLogic::sltOpenUSBDevicesSettingsDialog() { /* Machine settings: Storage page: */ sltOpenVMSettingsDialog("#usb"); } void UIMachineLogic::sltOpenSharedFoldersSettingsDialog() { /* Do not process if additions are not loaded! */ if (!uisession()->isGuestAdditionsActive()) popupCenter().remindAboutGuestAdditionsAreNotActive(activeMachineWindow()); /* Open VM settings : Shared folders page: */ sltOpenVMSettingsDialog("#sharedFolders"); } void UIMachineLogic::sltMountStorageMedium() { /* Sender action: */ QAction *pAction = qobject_cast<QAction*>(sender()); AssertMsgReturnVoid(pAction, ("This slot should only be called by menu action!\n")); /* Current mount-target: */ const UIMediumTarget target = pAction->data().value<UIMediumTarget>(); /* Update current machine mount-target: */ vboxGlobal().updateMachineStorage(machine(), target); } void UIMachineLogic::sltAttachUSBDevice() { /* Get and check sender action object: */ QAction *pAction = qobject_cast<QAction*>(sender()); AssertMsg(pAction, ("This slot should only be called on selecting USB menu item!\n")); /* Get operation target: */ USBTarget target = pAction->data().value<USBTarget>(); /* Attach USB device: */ if (target.attach) { /* Try to attach corresponding device: */ console().AttachUSBDevice(target.id, QString("")); /* Check if console is OK: */ if (!console().isOk()) { /* Get current host: */ CHost host = vboxGlobal().host(); /* Search the host for the corresponding USB device: */ CHostUSBDevice hostDevice = host.FindUSBDeviceById(target.id); /* Get USB device from host USB device: */ CUSBDevice device(hostDevice); /* Show a message about procedure failure: */ popupCenter().cannotAttachUSBDevice(activeMachineWindow(), console(), vboxGlobal().details(device)); } } /* Detach USB device: */ else { /* Search the console for the corresponding USB device: */ CUSBDevice device = console().FindUSBDeviceById(target.id); /* Try to detach corresponding device: */ console().DetachUSBDevice(target.id); /* Check if console is OK: */ if (!console().isOk()) { /* Show a message about procedure failure: */ popupCenter().cannotDetachUSBDevice(activeMachineWindow(), console(), vboxGlobal().details(device)); } } } void UIMachineLogic::sltAttachWebCamDevice() { /* Get and check sender action object: */ QAction *pAction = qobject_cast<QAction*>(sender()); AssertReturnVoid(pAction); /* Get operation target: */ WebCamTarget target = pAction->data().value<WebCamTarget>(); /* Get current emulated USB: */ CEmulatedUSB dispatcher = console().GetEmulatedUSB(); /* Attach webcam device: */ if (target.attach) { /* Try to attach corresponding device: */ dispatcher.WebcamAttach(target.path, ""); /* Check if dispatcher is OK: */ if (!dispatcher.isOk()) popupCenter().cannotAttachWebCam(activeMachineWindow(), dispatcher, target.name, machineName()); } /* Detach webcam device: */ else { /* Try to detach corresponding device: */ dispatcher.WebcamDetach(target.path); /* Check if dispatcher is OK: */ if (!dispatcher.isOk()) popupCenter().cannotDetachWebCam(activeMachineWindow(), dispatcher, target.name, machineName()); } } void UIMachineLogic::sltChangeSharedClipboardType(QAction *pAction) { /* Assign new mode (without save): */ KClipboardMode mode = pAction->data().value<KClipboardMode>(); machine().SetClipboardMode(mode); } void UIMachineLogic::sltToggleNetworkAdapterConnection() { /* Do not process if window(s) missed! */ if (!isMachineWindowsCreated()) return; /* Get and check 'the sender' action object: */ QAction *pAction = qobject_cast<QAction*>(sender()); AssertMsgReturnVoid(pAction, ("Sender action should NOT be null!\n")); /* Get operation target: */ CNetworkAdapter adapter = machine().GetNetworkAdapter((ULONG)pAction->property("slot").toInt()); AssertMsgReturnVoid(machine().isOk() && !adapter.isNull(), ("Network adapter should NOT be null!\n")); /* Connect/disconnect cable to/from target: */ const bool fConnect = !adapter.GetCableConnected(); adapter.SetCableConnected(fConnect); if (!adapter.isOk()) return popupCenter().cannotToggleNetworkAdapterCable(activeMachineWindow(), adapter, machineName(), fConnect); /* Save machine-settings: */ machine().SaveSettings(); if (!machine().isOk()) return msgCenter().cannotSaveMachineSettings(machine()); } void UIMachineLogic::sltChangeDragAndDropType(QAction *pAction) { /* Assign new mode (without save): */ KDnDMode mode = pAction->data().value<KDnDMode>(); machine().SetDnDMode(mode); } void UIMachineLogic::sltInstallGuestAdditions() { /* Do not process if window(s) missed! */ if (!isMachineWindowsCreated()) return; CSystemProperties systemProperties = vboxGlobal().virtualBox().GetSystemProperties(); QString strAdditions = systemProperties.GetDefaultAdditionsISO(); if (systemProperties.isOk() && !strAdditions.isEmpty()) return uisession()->sltInstallGuestAdditionsFrom(strAdditions); /* Check for the already registered image */ CVirtualBox vbox = vboxGlobal().virtualBox(); const QString &strName = QString("%1_%2.iso").arg(GUI_GuestAdditionsName, vboxGlobal().vboxVersionStringNormalized()); CMediumVector vec = vbox.GetDVDImages(); for (CMediumVector::ConstIterator it = vec.begin(); it != vec.end(); ++ it) { QString path = it->GetLocation(); /* Compare the name part ignoring the file case */ QString fn = QFileInfo(path).fileName(); if (RTPathCompare(strName.toUtf8().constData(), fn.toUtf8().constData()) == 0) return uisession()->sltInstallGuestAdditionsFrom(path); } #ifdef VBOX_GUI_WITH_NETWORK_MANAGER /* If downloader is running already: */ if (UIDownloaderAdditions::current()) { /* Just show network access manager: */ gNetworkManager->show(); } /* Else propose to download additions: */ else if (msgCenter().cannotFindGuestAdditions()) { /* Create Additions downloader: */ UIDownloaderAdditions *pDl = UIDownloaderAdditions::create(); /* After downloading finished => propose to install the Additions: */ connect(pDl, SIGNAL(sigDownloadFinished(const QString&)), uisession(), SLOT(sltInstallGuestAdditionsFrom(const QString&))); /* Start downloading: */ pDl->start(); } #endif /* VBOX_GUI_WITH_NETWORK_MANAGER */ } #ifdef VBOX_WITH_DEBUGGER_GUI void UIMachineLogic::sltShowDebugStatistics() { if (dbgCreated()) { keyboardHandler()->setDebuggerActive(); m_pDbgGuiVT->pfnShowStatistics(m_pDbgGui); } } void UIMachineLogic::sltShowDebugCommandLine() { if (dbgCreated()) { keyboardHandler()->setDebuggerActive(); m_pDbgGuiVT->pfnShowCommandLine(m_pDbgGui); } } void UIMachineLogic::sltLoggingToggled(bool fState) { NOREF(fState); if (!debugger().isNull() && debugger().isOk()) debugger().SetLogEnabled(fState); } void UIMachineLogic::sltShowLogDialog() { if (machine().isNull() || !activeMachineWindow()) return; /* Create a logviewer only if we don't have one already */ if (m_pLogViewerDialog) return; QIManagerDialog *pLogViewerDialog; UIVMLogViewerDialogFactory dialogFactory(machine()); dialogFactory.prepare(pLogViewerDialog, activeMachineWindow()); if (pLogViewerDialog) { m_pLogViewerDialog = pLogViewerDialog; /* Show instance: */ pLogViewerDialog->show(); pLogViewerDialog->setWindowState(pLogViewerDialog->windowState() & ~Qt::WindowMinimized); pLogViewerDialog->activateWindow(); connect(pLogViewerDialog, &QIManagerDialog::sigClose, this, &UIMachineLogic::sltCloseLogViewerWindow); } } void UIMachineLogic::sltCloseLogViewerWindow() { QIManagerDialog* pDialog = qobject_cast<QIManagerDialog*>(sender()); if (m_pLogViewerDialog != pDialog || !pDialog) return; /* Set the m_pLogViewerDialog to NULL before closing the dialog. or we will have redundant deletes*/ m_pLogViewerDialog = 0; pDialog->close(); UIVMLogViewerDialogFactory(CMachine()).cleanup(pDialog); } #endif /* VBOX_WITH_DEBUGGER_GUI */ #ifdef VBOX_WS_MAC void UIMachineLogic::sltSwitchToMachineWindow() { /* Acquire appropriate sender action: */ const QAction *pSender = qobject_cast<QAction*>(sender()); AssertReturnVoid(pSender); { /* Determine sender action index: */ const int iIndex = pSender->data().toInt(); AssertReturnVoid(iIndex >= 0 && iIndex < machineWindows().size()); { /* Raise appropriate machine-window: */ UIMachineWindow *pMachineWindow = machineWindows().at(iIndex); AssertPtrReturnVoid(pMachineWindow); { pMachineWindow->show(); pMachineWindow->raise(); pMachineWindow->activateWindow(); } } } } void UIMachineLogic::sltDockPreviewModeChanged(QAction *pAction) { bool fEnabled = pAction != actionPool()->action(UIActionIndexRT_M_Dock_M_DockSettings_T_DisableMonitor); gEDataManager->setRealtimeDockIconUpdateEnabled(fEnabled, vboxGlobal().managedVMUuid()); updateDockOverlay(); } void UIMachineLogic::sltDockPreviewMonitorChanged(QAction *pAction) { gEDataManager->setRealtimeDockIconUpdateMonitor(pAction->data().toInt(), vboxGlobal().managedVMUuid()); updateDockOverlay(); } void UIMachineLogic::sltChangeDockIconUpdate(bool fEnabled) { if (isMachineWindowsCreated()) { setDockIconPreviewEnabled(fEnabled); if (m_pDockPreviewSelectMonitorGroup) { m_pDockPreviewSelectMonitorGroup->setEnabled(fEnabled); m_DockIconPreviewMonitor = qMin(gEDataManager->realtimeDockIconUpdateMonitor(vboxGlobal().managedVMUuid()), (int)machine().GetMonitorCount() - 1); } /* Resize the dock icon in the case the preview monitor has changed. */ QSize size = machineWindows().at(m_DockIconPreviewMonitor)->machineView()->size(); updateDockIconSize(m_DockIconPreviewMonitor, size.width(), size.height()); updateDockOverlay(); } } void UIMachineLogic::sltChangeDockIconOverlayAppearance(bool fDisabled) { /* Update dock icon overlay: */ if (isMachineWindowsCreated()) updateDockOverlay(); /* Make sure to update dock icon disable overlay action state when 'GUI_DockIconDisableOverlay' changed from extra-data manager: */ QAction *pDockIconDisableOverlay = actionPool()->action(UIActionIndexRT_M_Dock_M_DockSettings_T_DisableOverlay); if (fDisabled != pDockIconDisableOverlay->isChecked()) { /* Block signals initially to avoid recursive loop: */ pDockIconDisableOverlay->blockSignals(true); /* Update state: */ pDockIconDisableOverlay->setChecked(fDisabled); /* Make sure to unblock signals again: */ pDockIconDisableOverlay->blockSignals(false); } } void UIMachineLogic::sltDockIconDisableOverlayChanged(bool fDisabled) { /* Write dock icon disable overlay flag to extra-data: */ gEDataManager->setDockIconDisableOverlay(fDisabled, vboxGlobal().managedVMUuid()); } #endif /* VBOX_WS_MAC */ void UIMachineLogic::sltSwitchKeyboardLedsToGuestLeds() { /* Due to async nature of that feature * it can happen that this slot is called when machine-window is * minimized or not active anymore, we should ignore those cases. */ QWidget *pActiveWindow = QApplication::activeWindow(); if ( !pActiveWindow // no window is active anymore || !qobject_cast<UIMachineWindow*>(pActiveWindow) // window is not machine one || pActiveWindow->isMinimized()) // window is minimized { LogRel2(("GUI: HID LEDs Sync: skipping sync because active window is lost or minimized!\n")); return; } // /* Log statement (printf): */ // QString strDt = QDateTime::currentDateTime().toString("HH:mm:ss:zzz"); // printf("%s: UIMachineLogic: sltSwitchKeyboardLedsToGuestLeds called, machine name is {%s}\n", // strDt.toUtf8().constData(), // machineName().toUtf8().constData()); /* Here we have to store host LED lock states. */ /* Here we have to update host LED lock states using values provided by UISession registry. * [bool] uisession() -> isNumLock(), isCapsLock(), isScrollLock() can be used for that. */ if (!isHidLedsSyncEnabled()) return; #if defined(VBOX_WS_MAC) if (m_pHostLedsState == NULL) m_pHostLedsState = DarwinHidDevicesKeepLedsState(); DarwinHidDevicesBroadcastLeds(m_pHostLedsState, uisession()->isNumLock(), uisession()->isCapsLock(), uisession()->isScrollLock()); #elif defined(VBOX_WS_WIN) if (m_pHostLedsState == NULL) m_pHostLedsState = WinHidDevicesKeepLedsState(); keyboardHandler()->winSkipKeyboardEvents(true); WinHidDevicesBroadcastLeds(uisession()->isNumLock(), uisession()->isCapsLock(), uisession()->isScrollLock()); keyboardHandler()->winSkipKeyboardEvents(false); #else LogRelFlow(("UIMachineLogic::sltSwitchKeyboardLedsToGuestLeds: keep host LED lock states and broadcast guest's ones does not supported on this platform\n")); #endif } void UIMachineLogic::sltSwitchKeyboardLedsToPreviousLeds() { // /* Log statement (printf): */ // QString strDt = QDateTime::currentDateTime().toString("HH:mm:ss:zzz"); // printf("%s: UIMachineLogic: sltSwitchKeyboardLedsToPreviousLeds called, machine name is {%s}\n", // strDt.toUtf8().constData(), // machineName().toUtf8().constData()); if (!isHidLedsSyncEnabled()) return; /* Here we have to restore host LED lock states. */ void *pvLedState = m_pHostLedsState; if (pvLedState) { /* bird: I've observed recursive calls here when setting m_pHostLedsState to NULL after calling WinHidDevicesApplyAndReleaseLedsState. The result is a double free(), which the CRT usually detects and I could see this->m_pHostLedsState == NULL. The windows function does dispatch loop fun, that's probably the reason for it. Hopefully not an issue on OS X. */ m_pHostLedsState = NULL; #if defined(VBOX_WS_MAC) DarwinHidDevicesApplyAndReleaseLedsState(pvLedState); #elif defined(VBOX_WS_WIN) keyboardHandler()->winSkipKeyboardEvents(true); WinHidDevicesApplyAndReleaseLedsState(pvLedState); keyboardHandler()->winSkipKeyboardEvents(false); #else LogRelFlow(("UIMachineLogic::sltSwitchKeyboardLedsToPreviousLeds: restore host LED lock states does not supported on this platform\n")); #endif } } void UIMachineLogic::sltShowGlobalPreferences() { /* Do not process if window(s) missed! */ if (!isMachineWindowsCreated()) return; /* Just show Global Preferences: */ showGlobalPreferences(); } void UIMachineLogic::updateMenuDevicesStorage(QMenu *pMenu) { /* Clear contents: */ pMenu->clear(); /* Determine device-type: */ const QMenu *pOpticalDevicesMenu = actionPool()->action(UIActionIndexRT_M_Devices_M_OpticalDevices)->menu(); const QMenu *pFloppyDevicesMenu = actionPool()->action(UIActionIndexRT_M_Devices_M_FloppyDevices)->menu(); const KDeviceType deviceType = pMenu == pOpticalDevicesMenu ? KDeviceType_DVD : pMenu == pFloppyDevicesMenu ? KDeviceType_Floppy : KDeviceType_Null; AssertMsgReturnVoid(deviceType != KDeviceType_Null, ("Incorrect storage device-type!\n")); /* Prepare/fill all storage menus: */ foreach (const CMediumAttachment &attachment, machine().GetMediumAttachments()) { /* Current controller: */ const CStorageController controller = machine().GetStorageControllerByName(attachment.GetController()); /* If controller present and device-type correct: */ if (!controller.isNull() && attachment.GetType() == deviceType) { /* Current controller/attachment attributes: */ const QString strControllerName = controller.GetName(); const StorageSlot storageSlot(controller.GetBus(), attachment.GetPort(), attachment.GetDevice()); /* Prepare current storage menu: */ QMenu *pStorageMenu = 0; /* If it will be more than one storage menu: */ if (pMenu->menuAction()->data().toInt() > 1) { /* We have to create sub-menu for each of them: */ pStorageMenu = new QMenu(QString("%1 (%2)").arg(strControllerName).arg(gpConverter->toString(storageSlot)), pMenu); switch (controller.GetBus()) { case KStorageBus_IDE: pStorageMenu->setIcon(QIcon(":/ide_16px.png")); break; case KStorageBus_SATA: pStorageMenu->setIcon(QIcon(":/sata_16px.png")); break; case KStorageBus_SCSI: pStorageMenu->setIcon(QIcon(":/scsi_16px.png")); break; case KStorageBus_Floppy: pStorageMenu->setIcon(QIcon(":/floppy_16px.png")); break; case KStorageBus_SAS: pStorageMenu->setIcon(QIcon(":/sata_16px.png")); break; case KStorageBus_USB: pStorageMenu->setIcon(QIcon(":/usb_16px.png")); break; default: break; } pMenu->addMenu(pStorageMenu); } /* Otherwise just use existing one: */ else pStorageMenu = pMenu; /* Fill current storage menu: */ vboxGlobal().prepareStorageMenu(*pStorageMenu, this, SLOT(sltMountStorageMedium()), machine(), strControllerName, storageSlot); } } } void UIMachineLogic::updateMenuDevicesNetwork(QMenu *pMenu) { /* Determine how many adapters we should display: */ const KChipsetType chipsetType = machine().GetChipsetType(); const ULONG uCount = qMin((ULONG)4, vboxGlobal().virtualBox().GetSystemProperties().GetMaxNetworkAdapters(chipsetType)); /* Enumerate existing network adapters: */ QMap<int, bool> adapterData; for (ULONG uSlot = 0; uSlot < uCount; ++uSlot) { /* Get and check iterated adapter: */ const CNetworkAdapter adapter = machine().GetNetworkAdapter(uSlot); AssertReturnVoid(machine().isOk() && !adapter.isNull()); /* Skip disabled adapters: */ if (!adapter.GetEnabled()) continue; /* Remember adapter data: */ adapterData.insert((int)uSlot, (bool)adapter.GetCableConnected()); } /* Make sure at least one adapter was enabled: */ if (adapterData.isEmpty()) return; /* Add new actions: */ foreach (int iSlot, adapterData.keys()) { QAction *pAction = pMenu->addAction(UIIconPool::iconSetOnOff(":/connect_on_16px.png", ":/connect_16px.png"), adapterData.size() == 1 ? UIActionPool::tr("&Connect Network Adapter") : UIActionPool::tr("Connect Network Adapter &%1").arg(iSlot + 1), this, SLOT(sltToggleNetworkAdapterConnection())); pAction->setProperty("slot", iSlot); pAction->setCheckable(true); pAction->setChecked(adapterData[iSlot]); } } void UIMachineLogic::updateMenuDevicesUSB(QMenu *pMenu) { /* Get current host: */ const CHost host = vboxGlobal().host(); /* Get host USB device list: */ const CHostUSBDeviceVector devices = host.GetUSBDevices(); /* If device list is empty: */ if (devices.isEmpty()) { /* Add only one - "empty" action: */ QAction *pEmptyMenuAction = pMenu->addAction(UIIconPool::iconSet(":/usb_unavailable_16px.png", ":/usb_unavailable_disabled_16px.png"), UIActionPool::tr("No USB Devices Connected")); pEmptyMenuAction->setToolTip(UIActionPool::tr("No supported devices connected to the host PC")); pEmptyMenuAction->setEnabled(false); } /* If device list is NOT empty: */ else { /* Populate menu with host USB devices: */ foreach (const CHostUSBDevice& hostDevice, devices) { /* Get USB device from current host USB device: */ const CUSBDevice device(hostDevice); /* Create USB device action: */ QAction *pAttachUSBAction = pMenu->addAction(vboxGlobal().details(device), this, SLOT(sltAttachUSBDevice())); pAttachUSBAction->setToolTip(vboxGlobal().toolTip(device)); pAttachUSBAction->setCheckable(true); /* Check if that USB device was already attached to this session: */ const CUSBDevice attachedDevice = console().FindUSBDeviceById(device.GetId()); pAttachUSBAction->setChecked(!attachedDevice.isNull()); pAttachUSBAction->setEnabled(hostDevice.GetState() != KUSBDeviceState_Unavailable); /* Set USB attach data: */ pAttachUSBAction->setData(QVariant::fromValue(USBTarget(!pAttachUSBAction->isChecked(), device.GetId()))); } } } void UIMachineLogic::updateMenuDevicesWebCams(QMenu *pMenu) { /* Clear contents: */ pMenu->clear(); /* Get current host: */ const CHost host = vboxGlobal().host(); /* Get host webcam list: */ const CHostVideoInputDeviceVector webcams = host.GetVideoInputDevices(); /* If webcam list is empty: */ if (webcams.isEmpty()) { /* Add only one - "empty" action: */ QAction *pEmptyMenuAction = pMenu->addAction(UIIconPool::iconSet(":/web_camera_unavailable_16px.png", ":/web_camera_unavailable_disabled_16px.png"), UIActionPool::tr("No Webcams Connected")); pEmptyMenuAction->setToolTip(UIActionPool::tr("No supported webcams connected to the host PC")); pEmptyMenuAction->setEnabled(false); } /* If webcam list is NOT empty: */ else { /* Populate menu with host webcams: */ const QVector<QString> attachedWebcamPaths = console().GetEmulatedUSB().GetWebcams(); foreach (const CHostVideoInputDevice &webcam, webcams) { /* Get webcam data: */ const QString strWebcamName = webcam.GetName(); const QString strWebcamPath = webcam.GetPath(); /* Create/configure webcam action: */ QAction *pAttachWebcamAction = pMenu->addAction(strWebcamName, this, SLOT(sltAttachWebCamDevice())); pAttachWebcamAction->setToolTip(vboxGlobal().toolTip(webcam)); pAttachWebcamAction->setCheckable(true); /* Check if that webcam was already attached to this session: */ pAttachWebcamAction->setChecked(attachedWebcamPaths.contains(strWebcamPath)); /* Set USB attach data: */ pAttachWebcamAction->setData(QVariant::fromValue(WebCamTarget(!pAttachWebcamAction->isChecked(), strWebcamName, strWebcamPath))); } } } void UIMachineLogic::updateMenuDevicesSharedClipboard(QMenu *pMenu) { /* First run: */ if (!m_pSharedClipboardActions) { m_pSharedClipboardActions = new QActionGroup(this); for (int i = KClipboardMode_Disabled; i < KClipboardMode_Max; ++i) { KClipboardMode mode = (KClipboardMode)i; QAction *pAction = new QAction(gpConverter->toString(mode), m_pSharedClipboardActions); pMenu->addAction(pAction); pAction->setData(QVariant::fromValue(mode)); pAction->setCheckable(true); pAction->setChecked(machine().GetClipboardMode() == mode); } connect(m_pSharedClipboardActions, SIGNAL(triggered(QAction*)), this, SLOT(sltChangeSharedClipboardType(QAction*))); } /* Subsequent runs: */ else foreach (QAction *pAction, m_pSharedClipboardActions->actions()) if (pAction->data().value<KClipboardMode>() == machine().GetClipboardMode()) pAction->setChecked(true); } void UIMachineLogic::updateMenuDevicesDragAndDrop(QMenu *pMenu) { /* First run: */ if (!m_pDragAndDropActions) { m_pDragAndDropActions = new QActionGroup(this); for (int i = KDnDMode_Disabled; i < KDnDMode_Max; ++i) { KDnDMode mode = (KDnDMode)i; QAction *pAction = new QAction(gpConverter->toString(mode), m_pDragAndDropActions); pMenu->addAction(pAction); pAction->setData(QVariant::fromValue(mode)); pAction->setCheckable(true); pAction->setChecked(machine().GetDnDMode() == mode); } connect(m_pDragAndDropActions, SIGNAL(triggered(QAction*)), this, SLOT(sltChangeDragAndDropType(QAction*))); } /* Subsequent runs: */ else foreach (QAction *pAction, m_pDragAndDropActions->actions()) if (pAction->data().value<KDnDMode>() == machine().GetDnDMode()) pAction->setChecked(true); } #ifdef VBOX_WITH_DEBUGGER_GUI void UIMachineLogic::updateMenuDebug(QMenu*) { /* The "Logging" item. */ bool fEnabled = false; bool fChecked = false; if (!debugger().isNull() && debugger().isOk()) { fEnabled = true; fChecked = debugger().GetLogEnabled() != FALSE; } if (fEnabled != actionPool()->action(UIActionIndexRT_M_Debug_T_Logging)->isEnabled()) actionPool()->action(UIActionIndexRT_M_Debug_T_Logging)->setEnabled(fEnabled); if (fChecked != actionPool()->action(UIActionIndexRT_M_Debug_T_Logging)->isChecked()) actionPool()->action(UIActionIndexRT_M_Debug_T_Logging)->setChecked(fChecked); } #endif /* VBOX_WITH_DEBUGGER_GUI */ #ifdef VBOX_WS_MAC void UIMachineLogic::updateMenuWindow(QMenu *pMenu) { /* Make sure 'Switch' action(s) are allowed: */ AssertPtrReturnVoid(actionPool()); if (actionPool()->isAllowedInMenuWindow(UIExtraDataMetaDefs::MenuWindowActionType_Switch)) { /* Append menu with actions to switch to machine-window(s): */ foreach (UIMachineWindow *pMachineWindow, machineWindows()) { /* Create machine-window action: */ AssertPtrReturnVoid(pMachineWindow); QAction *pMachineWindowAction = pMenu->addAction(pMachineWindow->windowTitle(), this, SLOT(sltSwitchToMachineWindow())); AssertPtrReturnVoid(pMachineWindowAction); { pMachineWindowAction->setCheckable(true); pMachineWindowAction->setChecked(activeMachineWindow() == pMachineWindow); pMachineWindowAction->setData((int)pMachineWindow->screenId()); } } } } #endif /* VBOX_WS_MAC */ void UIMachineLogic::showGlobalPreferences(const QString &strCategory /* = QString() */, const QString &strControl /* = QString() */) { /* Do not process if window(s) missed! */ if (!isMachineWindowsCreated()) return; /* Check that we do NOT handling that already: */ if (actionPool()->action(UIActionIndex_M_Application_S_Preferences)->data().toBool()) return; /* Remember that we handling that already: */ actionPool()->action(UIActionIndex_M_Application_S_Preferences)->setData(true); /* Create and execute global settings window: */ QPointer<UISettingsDialogGlobal> pDialog = new UISettingsDialogGlobal(activeMachineWindow(), strCategory, strControl); pDialog->execute(); if (pDialog) delete pDialog; /* Remember that we do NOT handling that already: */ actionPool()->action(UIActionIndex_M_Application_S_Preferences)->setData(false); } void UIMachineLogic::askUserForTheDiskEncryptionPasswords() { /* Prepare the map of the encrypted mediums: */ EncryptedMediumMap encryptedMediums; foreach (const CMediumAttachment &attachment, machine().GetMediumAttachments()) { /* Acquire hard-drive attachments only: */ if (attachment.GetType() == KDeviceType_HardDisk) { /* Get the attachment medium base: */ const CMedium medium = attachment.GetMedium(); /* Update the map with this medium if it's encrypted: */ QString strCipher; const QString strPasswordId = medium.GetEncryptionSettings(strCipher); if (medium.isOk()) encryptedMediums.insert(strPasswordId, medium.GetId()); } } /* Ask for the disk encryption passwords if necessary: */ EncryptionPasswordMap encryptionPasswords; if (!encryptedMediums.isEmpty()) { /* Create the dialog for acquiring encryption passwords: */ QWidget *pDlgParent = windowManager().realParentWindow(activeMachineWindow()); QPointer<UIAddDiskEncryptionPasswordDialog> pDlg = new UIAddDiskEncryptionPasswordDialog(pDlgParent, machineName(), encryptedMediums); /* Execute the dialog: */ if (pDlg->exec() == QDialog::Accepted) { /* Acquire the passwords provided: */ encryptionPasswords = pDlg->encryptionPasswords(); /* Delete the dialog: */ delete pDlg; /* Make sure the passwords were really provided: */ AssertReturnVoid(!encryptionPasswords.isEmpty()); /* Apply the disk encryption passwords: */ foreach (const QString &strKey, encryptionPasswords.keys()) { console().AddDiskEncryptionPassword(strKey, encryptionPasswords.value(strKey), false); if (!console().isOk()) msgCenter().cannotAddDiskEncryptionPassword(console()); } } else { /* Any modal dialog can be destroyed in own event-loop * as a part of VM power-off procedure which closes GUI. * So we have to check if the dialog still valid.. */ /* If dialog still valid: */ if (pDlg) { /* Delete the dialog: */ delete pDlg; /* Propose the user to close VM: */ LogRel(("GUI: Request to close Runtime UI due to DEK was not provided.\n")); QMetaObject::invokeMethod(this, "sltClose", Qt::QueuedConnection); } } } } int UIMachineLogic::searchMaxSnapshotIndex(const CMachine &machine, const CSnapshot &snapshot, const QString &strNameTemplate) { int iMaxIndex = 0; QRegExp regExp(QString("^") + strNameTemplate.arg("([0-9]+)") + QString("$")); if (!snapshot.isNull()) { /* Check the current snapshot name */ QString strName = snapshot.GetName(); int iPos = regExp.indexIn(strName); if (iPos != -1) iMaxIndex = regExp.cap(1).toInt() > iMaxIndex ? regExp.cap(1).toInt() : iMaxIndex; /* Traversing all the snapshot children */ foreach (const CSnapshot &child, snapshot.GetChildren()) { int iMaxIndexOfChildren = searchMaxSnapshotIndex(machine, child, strNameTemplate); iMaxIndex = iMaxIndexOfChildren > iMaxIndex ? iMaxIndexOfChildren : iMaxIndex; } } return iMaxIndex; } void UIMachineLogic::takeScreenshot(const QString &strFile, const QString &strFormat /* = "png" */) const { /* Get console: */ const int cGuestScreens = machine().GetMonitorCount(); QList<QImage> images; ULONG uMaxWidth = 0; ULONG uMaxHeight = 0; /* First create screenshots of all guest screens and save them in a list. * Also sum the width of all images and search for the biggest image height. */ for (int i = 0; i < cGuestScreens; ++i) { ULONG width = 0; ULONG height = 0; ULONG bpp = 0; LONG xOrigin = 0; LONG yOrigin = 0; KGuestMonitorStatus monitorStatus = KGuestMonitorStatus_Enabled; display().GetScreenResolution(i, width, height, bpp, xOrigin, yOrigin, monitorStatus); uMaxWidth += width; uMaxHeight = RT_MAX(uMaxHeight, height); QImage shot = QImage(width, height, QImage::Format_RGB32); /* For separate process: */ if (vboxGlobal().isSeparateProcess()) { /* Take screen-data to array first: */ const QVector<BYTE> screenData = display().TakeScreenShotToArray(i, shot.width(), shot.height(), KBitmapFormat_BGR0); /* And copy that data to screen-shot if it is Ok: */ if (display().isOk() && !screenData.isEmpty()) memcpy(shot.bits(), screenData.data(), shot.width() * shot.height() * 4); } /* For the same process: */ else { /* Take the screen-shot directly: */ display().TakeScreenShot(i, shot.bits(), shot.width(), shot.height(), KBitmapFormat_BGR0); } images << shot; } /* Create a image which will hold all sub images vertically. */ QImage bigImg = QImage(uMaxWidth, uMaxHeight, QImage::Format_RGB32); QPainter p(&bigImg); ULONG w = 0; /* Paint them. */ for (int i = 0; i < images.size(); ++i) { p.drawImage(w, 0, images.at(i)); w += images.at(i).width(); } p.end(); /* Save the big image in the requested format: */ const QFileInfo fi(strFile); const QString &strPathWithoutSuffix = QDir(fi.absolutePath()).absoluteFilePath(fi.baseName()); const QString &strSuffix = fi.suffix().isEmpty() ? strFormat : fi.suffix(); bigImg.save(QDir::toNativeSeparators(QFile::encodeName(QString("%1.%2").arg(strPathWithoutSuffix, strSuffix))), strFormat.toUtf8().constData()); } #ifdef VBOX_WITH_DEBUGGER_GUI bool UIMachineLogic::dbgCreated() { if (m_pDbgGui) return true; RTLDRMOD hLdrMod = vboxGlobal().getDebuggerModule(); if (hLdrMod == NIL_RTLDRMOD) return false; PFNDBGGUICREATE pfnGuiCreate; int rc = RTLdrGetSymbol(hLdrMod, "DBGGuiCreate", (void**)&pfnGuiCreate); if (RT_SUCCESS(rc)) { ISession *pISession = session().raw(); rc = pfnGuiCreate(pISession, &m_pDbgGui, &m_pDbgGuiVT); if (RT_SUCCESS(rc)) { if ( DBGGUIVT_ARE_VERSIONS_COMPATIBLE(m_pDbgGuiVT->u32Version, DBGGUIVT_VERSION) || m_pDbgGuiVT->u32EndVersion == m_pDbgGuiVT->u32Version) { m_pDbgGuiVT->pfnSetParent(m_pDbgGui, activeMachineWindow()); m_pDbgGuiVT->pfnSetMenu(m_pDbgGui, actionPool()->action(UIActionIndexRT_M_Debug)); dbgAdjustRelativePos(); return true; } LogRel(("GUI: DBGGuiCreate failed, incompatible versions (loaded %#x/%#x, expected %#x)\n", m_pDbgGuiVT->u32Version, m_pDbgGuiVT->u32EndVersion, DBGGUIVT_VERSION)); } else LogRel(("GUI: DBGGuiCreate failed, rc=%Rrc\n", rc)); } else LogRel(("GUI: RTLdrGetSymbol(,\"DBGGuiCreate\",) -> %Rrc\n", rc)); m_pDbgGui = 0; m_pDbgGuiVT = 0; return false; } void UIMachineLogic::dbgDestroy() { if (m_pDbgGui) { m_pDbgGuiVT->pfnDestroy(m_pDbgGui); m_pDbgGui = 0; m_pDbgGuiVT = 0; } } void UIMachineLogic::dbgAdjustRelativePos() { if (m_pDbgGui) { QRect rct = activeMachineWindow()->frameGeometry(); m_pDbgGuiVT->pfnAdjustRelativePos(m_pDbgGui, rct.x(), rct.y(), rct.width(), rct.height()); } } #endif
# -*- coding: utf-8 -*- import decimal import datetime as dt from domainics.domobj import dobject, datt, dset from domainics.domobj.dset import dset from domainics.domobj.typing import DSet, DObject, AnyDObject import pytest def setup_module(module): print() # @pytest.mark.skipif def test_dset_declaration1(): class B(dobject): x = datt(int) y = datt(int) __dobject_key__ = [x] class A(dobject): a = datt(int) b = datt(dset(B)) __dobject_key__ = [a] a = A(a=1) a.b._add(B(x=1, y=11)) a.b._add(B(x=2, y=21)) a.b._add(B(x=3, y=31)) print(a) assert len(a.b) == 3
<reponame>tarof429/recmd-dmn package dmn import ( "crypto/sha1" "fmt" "strings" "time" ) // CommandStatus indicates the status of the command type CommandStatus string const ( // Idle means that the command is not running Idle CommandStatus = "Idle" // Running means that the command is running Running CommandStatus = "Running" // Completed means that the command is done Completed CommandStatus = "Completed" // Scheduled means that the command will run Scheduled CommandStatus = "Scheduled" // Failed means that the command failed Failed CommandStatus = "Failed" ) // Command represents a command and optionally a description to document what the command does type Command struct { CmdHash string `json:"commandHash"` CmdString string `json:"commandString"` Description string `json:"description"` Duration time.Duration `json:"duration"` WorkingDirectory string `json:"workingDirectory"` Status CommandStatus `json:"status"` } // Set sets the fields of a new Command func (cmd *Command) Set(cmdString string, cmdComment string, workingDirectory string) { formattedHash := func() string { h := sha1.New() h.Write([]byte(cmdString)) return fmt.Sprintf("%.15x", h.Sum(nil)) }() cmd.CmdHash = formattedHash cmd.CmdString = strings.Trim(cmdString, "") cmd.Description = strings.Trim(cmdComment, "") cmd.WorkingDirectory = strings.Trim(workingDirectory, "") cmd.Duration = -1 cmd.Status = Idle }
<reponame>yuanyedc/monitores<filename>src/main/java/com/msds/monitor/utils/EmailManager.java package com.msds.monitor.utils; import java.io.UnsupportedEncodingException; import java.util.Properties; import javax.activation.DataHandler; import javax.activation.FileDataSource; import javax.mail.BodyPart; import javax.mail.Message; import javax.mail.MessagingException; import javax.mail.Multipart; import javax.mail.Session; import javax.mail.Transport; import javax.mail.internet.InternetAddress; import javax.mail.internet.MimeBodyPart; import javax.mail.internet.MimeMessage; import javax.mail.internet.MimeMultipart; import javax.mail.internet.MimeUtility; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; @Service public class EmailManager { private Properties props; //系统属性 private Session session; //邮件会话对象 private MimeMessage mimeMsg; //MIME邮件对象 private Multipart mp; //Multipart对象,邮件内容,标题,附件等内容均添加到其中后再生成MimeMessage对象 @Value("${smtp_service}") private String smtp_service; @Value("${smtp_username}") private String smtp_username; @Value("${smtp_password}") private String smtp_password; @Value("${smtp_from}") private String smtp_from; /** * Constructor * @param smtp 邮件发送服务器 */ public EmailManager(){ props = System.getProperties(); props.put("mail.smtp.auth","false"); session = Session.getDefaultInstance(props, null); session.setDebug(true); mimeMsg = new MimeMessage(session); mp = new MimeMultipart(); } /** * Constructor * @param smtp 邮件发送服务器 */ public EmailManager(String smtp, String username, String password){ props = System.getProperties(); props.put("mail.smtp.auth","true"); props.put("mail.smtp.host", smtp); props.put("username", username); props.put("password", password); session = Session.getDefaultInstance(props, null); session.setDebug(true); mimeMsg = new MimeMessage(session); mp = new MimeMultipart(); } /** * 发送邮件 */ public boolean sendMail(String from, String to, String copyto, String subject, String content, String[] filename) { try { //设置发信人 mimeMsg.setFrom(new InternetAddress(from)); //设置接收人 mimeMsg.setRecipients(Message.RecipientType.TO, InternetAddress.parse(to)); //设置抄送人 mimeMsg.setRecipients(Message.RecipientType.CC, InternetAddress.parse(copyto)); //设置主题 mimeMsg.setSubject(subject); //设置正文 BodyPart bp = new MimeBodyPart(); bp.setContent(content, "text/html;charset=utf-8"); mp.addBodyPart(bp); //设置附件 if(filename!=null && filename.length>0){ for(int i = 0; i < filename.length; i++) { bp = new MimeBodyPart(); FileDataSource fileds = new FileDataSource(filename[i]); bp.setDataHandler(new DataHandler(fileds)); bp.setFileName(MimeUtility.encodeText(fileds.getName(),"UTF-8","B")); mp.addBodyPart(bp); } } mimeMsg.setContent(mp); mimeMsg.saveChanges(); //发送邮件 if(props.get("mail.smtp.auth").equals("true")){ Transport transport = session.getTransport("smtp"); transport.connect((String)props.get("mail.smtp.host"), (String)props.get("username"), (String)props.get("password")); transport.sendMessage(mimeMsg, mimeMsg.getRecipients(Message.RecipientType.TO)); transport.sendMessage(mimeMsg, mimeMsg.getRecipients(Message.RecipientType.CC)); transport.close(); }else{ Transport.send(mimeMsg); } System.out.println("邮件发送成功"); } catch (MessagingException e) { e.printStackTrace(); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } return true; } public void sendMonitorEmail(String to, String copyto, String subject, String content, String[] filename){ EmailManager email = new EmailManager(smtp_service, smtp_username, smtp_password); email.sendMail(smtp_from, to, copyto, subject, content, filename); } }
class EntityManager: """Manages all the entity in the game""" def __init__(self, div): self.handle_to_key = {} self.key_to_handle = {} self.div = div def dump(self): for k, v in self.key_to_handle.items(): print(k, v) def get_range(self, x, y): rx = int(x) % self.div ry = int(y) % self.div return (x - rx) + self.div / 2, (y - ry) + self.div / 2 def get_entity(self, x, y): """Get the entity at that position Returns ------- the stored entity or None Examples -------- >>> em = EntityManager(10) >>> em.add_entity('123', 100, 100) True >>> em.get_entity(100, 100) '123' >>> em.get_entity(101, 101) '123' >>> em.get_entity(120, 120) """ k = position_to_key(x, y, div=self.div) return self.key_to_handle.get(k) def update_position(self, handle, x, y): """Update the position of a given entity Returns ------- False if the entity was not found and was inserted Examples -------- >>> em = EntityManager(10) >>> em.add_entity('123', 10, 10) True >>> em.update_position('123', 12, 12) True >>> em.update_position('124', 12, 12) False """ return self._update_position(handle, position_to_key(x, y, div=self.div)) def _update_position(self, handle, key): good = False oldkey = self.handle_to_key.get(handle) self.handle_to_key[handle] = key if oldkey: self.key_to_handle.pop(oldkey, None) good = True self.key_to_handle[key] = handle return good def add_entity(self, handle, x, y): """Add a new entity at a given position. Returns ------- False if a key was overridden and True otherwise Examples -------- >>> em = EntityManager(10) >>> em.add_entity('123', 10, 10) True >>> em.add_entity('123', 10, 10) False """ dup = False key = position_to_key(x, y, div=self.div) if key in self.key_to_handle: log.debug('Duplicate key for entities') dup = True self._update_position(handle, key) return not dup def pop_entity(self, handle): """Remove a given entity from the manager Returns ------- False if the handle was not found, True otherwise Examples -------- >>> em = EntityManager(10) >>> em.add_entity('123', 10, 10) True >>> em.pop_entity('123') True >>> em.pop_entity('123') False """ oldkey = self.handle_to_key.pop(handle, None) if oldkey: self.key_to_handle.pop(oldkey, None) return True return False def __len__(self): return len(self.handle_to_key)
def initiateQuit(self): self.view.userIntent = 'quit' tb = self.view.textBuffer if tb.isDirty(): self.view.changeFocusTo(self.view.interactiveQuit) return bufferManager = self.view.program.bufferManager tb = bufferManager.getUnsavedBuffer() if tb: self.view.setTextBuffer(tb) self.view.changeFocusTo(self.view.interactiveQuit) return bufferManager.debugLog() self.view.quitNow()
package main import "fmt" func main() { var n, m int fmt.Scanf("%d %d", &n, &m) h := make([]int, n) for i := 0; i < n; i++ { fmt.Scan(&h[i]) } var a, b int counter := make(map[int]struct{}) for i := 0; i < m; i++ { fmt.Scanf("%d %d", &a, &b) if h[a-1] < h[b-1] { counter[a] = struct{}{} } else if h[a-1] > h[b-1] { counter[b] = struct{}{} } else if h[a-1] == h[b-1] { counter[a] = struct{}{} counter[b] = struct{}{} } } fmt.Println(n - len(counter)) }
/** * The Pen class used to control the movement of the pen * this class implements methods to: * control the pen to move upwards until it touches the touch sensor * control the pen to move downwards until it touches the plotting sketch * set the motor speed of the pen * create setters and getters for the pen motor, touch sensor used to stop pen motor and * the maximum motor angle that can be covered by the pen motor */ public class Pen { private NXTRegulatedMotor penMotor; private TouchSensor penTouchSensor; private int motorAngle; private boolean reverse; /** * Pen constructor initializes the Pen motor and the touch sensor used to stop the pen movement * configure the ports of the pen motor and the touch sensor * @param motorAngle the angle covered by the pen motor * @param reverse a flag condition to check the current positve/negative rotation direction of pen motor */ public Pen (int motorAngle, boolean reverse) { this.setPenMotor(Motor.B); this.setPenTouchSensor(new TouchSensor(SensorPort.S2)); this.setMotorAngle(motorAngle); this.setReverse(reverse); } /** * penUp method used to control the movement of the pen upwards by moving * till it presses the touch sensor and then stop the pen motor * @return boolean checks if the pen is touching the touch sensor */ public boolean penUp() { if (reverse == false) { while (!this.getPenTouchSensor().isPressed()) { this.getPenMotor().backward(); } this.getPenMotor().stop(); return true; } else { while (!this.getPenTouchSensor().isPressed()) { this.getPenMotor().forward(); } this.getPenMotor().stop(); return true; } } /** * penDown method used to control the movement of the pen downwards by * first checking if the pen is pressing the touch sensor, rotating it by * the calculated pen motor angle till it touches the sketch and then the pen motor stops * @return boolean checks if the pen is touching the sketch and not pressing the touch sensor */ public boolean penDown() { if (reverse == false) { if (this.getPenTouchSensor().isPressed()) { this.getPenMotor().rotate(this.getMotorAngle()); this.getPenMotor().stop(); return true; } else { this.getPenMotor().stop(); return false; } } else { if (this.getPenTouchSensor().isPressed()) { this.getPenMotor().rotate(-this.getMotorAngle()); this.getPenMotor().stop(); return true; } else { this.getPenMotor().stop(); return false; } } } /** * setPenMotorSpeed method to set the applied pen motor speed * @param speed the applied speed on the pen motor */ public void setPenMotorSpeed(int speed) { this.getPenMotor().setSpeed(speed); } /** * penMotorStop method to stop the motor of the pen */ public void penMotorStop() { this.getPenMotor().stop(); } /** * getPenMotor is a getter to get the motor used to control the Pen * @return NXTRegulatedMotor returns the motor of the Pen */ public NXTRegulatedMotor getPenMotor() { return this.penMotor; } /** * setPenMotor is a setter to set the Pen motor to be used * @param nxtRegulatedMotor the motor used to control the Pen movement */ public void setPenMotor(NXTRegulatedMotor penMotor) { this.penMotor = penMotor; } /** * getPenTouchSensor is a getter to get the port of Pen touch sensor * @return TouchSensor returns the Touch Sensor port used by the PlotBot to stop the pen */ public TouchSensor getPenTouchSensor() { return penTouchSensor; } /** * setPenTouchSensor is a setter to set the touch sensor port used to stop the Pen * @param penTouchSensor the touch sensor used to stop the movement of Pen */ public void setPenTouchSensor(TouchSensor penTouchSensor) { this.penTouchSensor = penTouchSensor; } /** * getMotorAngle is a getter to get the angle of the pen motor * @return int returns the motor angle that can be covered */ public int getMotorAngle() { return motorAngle; } /** * setMotorAngle is a setter to set the angle of the motor * @param motorAngle the angle to be covered by the pen motor */ public void setMotorAngle(int motorAngle) { this.motorAngle = motorAngle; } /** * isReverse is a getter to get the current value of direction flag condition * that determines the positive/negative direction of pen motor * @return boolean returns the value of flag */ public boolean isReverse() { return reverse; } /** * setReverse is a setter to set the boolean flag condition that determines * the positive/negative direction of pen motor * @param reverse boolean flag to check the direction */ public void setReverse(boolean reverse) { this.reverse = reverse; } }
def newArr(a, k): b = a i = 0 n = len(a) while i < n: b[i] += (i+1)*k i += 1 return b def minSum(a, k): a.sort() sm = 0 cnt = 0 i = 0 while i < k: sm += a[i] i += 1 return sm inp = input().split() n = int(inp[0]) S = int(inp[1]) inp = input().split() a = [] for x in inp: a.append(int(x)) l = 0 r = n while l<r: mid = (l+r)//2 if l+1 == r: mid = r b = newArr(list(a), mid) if minSum(b, mid) <= S: l = mid else: r = mid - 1 ans = l print(str(ans) + ' ' + str( minSum(newArr(a, ans), ans) ))
/* vglyph - library for visualize glyphs * * File: vglyph-point.h * Copyright (C) 2017 <NAME> */ #ifndef VGLYPH_POINT_H #define VGLYPH_POINT_H #include "vglyph-api.h" static inline vglyph_point_t* _vglyph_point_from_coord(vglyph_point_t* result, vglyph_float32_t x, vglyph_float32_t y) { assert(result); result->x = x; result->y = y; return result; } static inline vglyph_point_t* _vglyph_point_add(vglyph_point_t* result, const vglyph_point_t* a, const vglyph_point_t* b) { assert(result); assert(a); assert(b); result->x = a->x + b->x; result->y = a->y + b->y; return result; } static inline vglyph_point_t* _vglyph_point_sub(vglyph_point_t* result, const vglyph_point_t* a, const vglyph_point_t* b) { assert(result); assert(a); assert(b); result->x = a->x - b->x; result->y = a->y - b->y; return result; } static inline vglyph_point_t* _vglyph_point_mul(vglyph_point_t* result, const vglyph_point_t* a, vglyph_float32_t b) { assert(result); assert(a); result->x = a->x * b; result->y = a->y * b; return result; } static inline vglyph_point_t* _vglyph_point_div(vglyph_point_t* result, const vglyph_point_t* a, vglyph_float32_t b) { assert(result); assert(a); vglyph_float32_t inv_b = 1.0f / b; result->x = a->x * inv_b; result->y = a->y * inv_b; return result; } static inline vglyph_float32_t _vglyph_point_dot(const vglyph_point_t* a, const vglyph_point_t* b) { assert(a); assert(b); return a->x * b->x + a->y * b->y; } static inline vglyph_float32_t _vglyph_point_length_square(const vglyph_point_t* a) { assert(a); return a->x * a->x + a->y * a->y; } static inline vglyph_float32_t _vglyph_point_length(const vglyph_point_t* a) { assert(a); return sqrtf(_vglyph_point_length_square(a)); } static inline vglyph_point_t* _vglyph_point_normalize(vglyph_point_t* result, const vglyph_point_t* a) { assert(result); assert(a); vglyph_float32_t inv_length = 1.0f / _vglyph_point_length(a); result->x = a->x * inv_length; result->y = a->y * inv_length; return result; } static inline vglyph_point_t* _vglyph_point_min(vglyph_point_t* result, const vglyph_point_t* a, const vglyph_point_t* b) { assert(result); assert(a); assert(b); result->x = VGLYPH_MIN(a->x, b->x); result->y = VGLYPH_MIN(a->y, b->y); return result; } static inline vglyph_point_t* _vglyph_point_max(vglyph_point_t* result, const vglyph_point_t* a, const vglyph_point_t* b) { assert(result); assert(a); assert(b); result->x = VGLYPH_MAX(a->x, b->x); result->y = VGLYPH_MAX(a->y, b->y); return result; } #endif
<filename>actor/zipper.py<gh_stars>0 import subprocess as sr from errorclass.zipyerror import ZipyError import actor.filer as filer def create_zip_file(path, password, level): zip_file_path = filer.get_zip_file_path(path) compress_to_zip(path, zip_file_path, password) def compress_to_zip(dir_path, zip_file_path, password): try: p = sr.Popen(["zip", "-e", "-r", zip_file_path, dir_path, "-P", password, "-j"], stdout=sr.PIPE) output, err = p.communicate() print(output) except: raise ZipyError("ZIP圧縮に失敗しました。")
One-pot access to tetrahydrobenzo carbazoles from simple ketones by using O2 as an oxidant. An effective and operationally simple one-pot Brønsted acid catalyzed cascade method is demonstrated for the synthesis of diversely functionalized carbazole frameworks starting from protecting group free 2-alkenyl indoles. The employment of easily available unactivated ketones as annulating partners, mostly unexplored for the synthesis of carbazoles, is the major highlight of this protocol. This protocol is step- and atom-economical, uses molecular oxygen as the green oxidant, and gives water as the only by-product and is amenable to different functional groups. Moreover, gram-scale synthesis and downstream modification of the obtained products demonstrate the synthetic applicability of this protocol.
/* delete one extended attributes from the file */ void delete_xattr(const char* attr_name, const char* filename, int nofollow) { int rc = removexattr( filename, attr_name, (nofollow ? XATTR_NOFOLLOW : 0) ); if(rc < 0) { perror("removexattr"); exit(1); } }
/// Release this object, invalidating the pointer pub fn release(&mut self) { unsafe { PxBase_release_mut(self.get_raw_mut()); } }
<filename>extract/datasets/__init__.py from .data_loader import CATER_DataSet
/** * Unregister an interest in events for the given socket instance. * * @param registry The associated registry for managing events. * @param socketHandle The socket handle/file descriptor to remove. * @return WXNRC_OK on success, WXNRC_DATA_ERROR for unrecognized socket and * WXNRC_SYS_ERROR on underlying system error. */ int WXEvent_UnregisterEvent(WXEvent_Registry *registry, uint32_t socketHandle) { unsigned int entryIdx; #ifdef WXEVENT_USE_EPOLL struct epoll_event evt; #endif WXEVENT_STRUCT *entry = findEventEntry(registry, socketHandle); if (entry == NULL) return WXNRC_DATA_ERROR; #ifdef WXEVENT_USE_EPOLL (void) memset(&evt, 0, sizeof(evt)); if (epoll_ctl(registry->epollFd, EPOLL_CTL_DEL, (int) entry->socketHandle, &evt) < 0) { return WXNRC_SYS_ERROR; } #endif if ((entryIdx = entry - registry->entries) < registry->entryCount - 1) { (void) memmove(entry, entry + 1, (registry->entryCount - entryIdx - 1) * evtStructSize); #ifdef WXEVENT_USE_POLL (void) memmove(registry->fds + entryIdx, registry->fds + entryIdx + 1, (registry->entryCount - entryIdx - 1) * sizeof(struct pollfd)); #endif } registry->entryCount--; return WXNRC_OK; }
A Comparative Analysis on the Enforceability of Knock-for-Knock Indemnities in Thailand and the United Kingdom The standard form of oilfield service contracts, such as the Leading Oil and Gas Competitiveness (LOGIC) model, is widely used in Southeast Asia including Thailand. Under the LOGIC model form, the allocation of risk is set out by way of knock-for-knock indemnities where each party will indemnify the other for bodily injury or death of his employees and loss or damage to his property, regardless of negligence. However, under the Thai Unfair Contract Terms Act B.E. 2540 (A.D. 1997) (TUCTA), a contracting party is not allowed to restrict or exclude liabilities pertaining to bodily injury and death arising from his negligence. This restriction appears to be an attempt to hamper risk allocation in oilfield service contracts. On the other hand, the UK Unfair Contract Terms Act 1977 (UCTA) has a similar restriction. However, by virtue of the Supreme Court decision in Farstad Supply A/S v Enviroco Ltd UKSC 16, the knock-for-knock indemnities could be enforceable despite the restriction. Nevertheless, the knock-for-knock indemnities will be subject to the reasonableness test under UCTA. Thus, it could be argued that in spite of the restriction under TUCTA, the knock-for-knock indemnities in standard form oilfield service contracts e.g. LOGIC could still be enforceable in Thailand, subject to certain limitations. This note addresses the issue of enforceability of knock-for-knock indemnities pertaining to bodily injury and death in oilfield service contracts in Thailand.The methodology employed in this research will be a comparative analysis which will be carried out in a descriptive, analytic and prescriptive manner.
import numpy as np from .BaseElement import * class BuildingElement(BaseElement): def __init__(self, **params): super().__init__(**params)
<reponame>sibvisions/gauges import { Hook } from "./types"; export declare abstract class AbstractGauge<Options = {}> { protected options: Options; protected hooks: Hook[]; protected initial: boolean; constructor(options: Options, defaultOptions: Partial<Options>); protected addHook(callback: Function, keys: string[]): void; protected abstract updateData(combinedOptions: Options): any; protected update(options?: Partial<Options>): void; }
/// Determines the cell's value and returns the escape sequence for the appropriate value. pub fn color(&self) -> String { match self.value { 8 => format!("{}", Fg(Blue)), 16 => format!("{}", Fg(Yellow)), 32 => format!("{}", Fg(Magenta)), 64 => format!("{}", Fg(Red)), 128 => format!("{}", Fg(Green)), 256 => format!("{}", Fg(LightMagenta)), 512 => format!("{}", Fg(LightYellow)), 1024 => format!("{}", Fg(Cyan)), 2048 => format!("{}", Fg(LightRed)), 4096 => format!("{}", Fg(LightGreen)), 8192 => format!("{}", Fg(LightCyan)), _ => String::from(""), } }